> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# helper:constant

[localhost link]: http://localhost:3000/docs/5/app-studio/reference/tags/lightning.directive.helperConstant

[mintlify link]: https://doc.lucidworks.com/docs/5/app-studio/reference/tags/lightning.directive.helperConstant

[old doc.lw link]: https://doc.lucidworks.com/app-studio/4.2/1089.md

> [card] Key questions to get you started
>
> Powered by Lucidworks Agent Studio

## Description

The constant tagf adds a constant to the application.

## Usage

as element:

```xml wrap  theme={"dark"}
<helper:constant
       name="{string}"
       value="{string}">
</helper:constant>
```

### Directive info

* This directive creates new scope.

#### Parameters

| Param | Type | Details |
| - | - | - |
| name | **string** | The name of the constant |
| value | **string** | The value of the constant |

## Example

#### Source

```xml wrap  theme={"dark"}
<helper:constant name="test" value="banana"></helper:constant>
<span>My Constant: {{test}}</span>
```

```js wrap  theme={"dark"}
angular.module('lightning')
.controller('ExampleController', ['$scope','$twigkit', function($scope,$twigkit) {
            $scope.test = $twigkit.getConstant('test','noValue');
        }]);
```

#### Result

![Result](https://mintcdn.com/lucidworks/_JCWsGwGCZxJia7w/assets/images/app-studio/as-examples/tags/helperConstant.png?fit=max\&auto=format\&n=_JCWsGwGCZxJia7w\&q=85\&s=d82f95379ea48f8190528b716b91e10c)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.