Description

The constant tagf adds a constant to the application.

Usage

as element:
<helper:constant
       name="{string}"
       value="{string}">
</helper:constant>

Directive info

  • This directive creates new scope.

Parameters

ParamTypeDetails
namestringThe name of the constant
valuestringThe value of the constant

Example

Source

<helper:constant name="test" value="banana"></helper:constant>
<span>My Constant: {{test}}</span>
angular.module('lightning')
.controller('ExampleController', ['$scope','$twigkit', function($scope,$twigkit) {
            $scope.test = $twigkit.getConstant('test','noValue');
        }]);

Result

Result