p.
exported from angular2/annotations
defined in angular2/src/core/annotations/di.js (line 53)
:markdown
Specifies that a constant attribute value should be injected.
The directive can inject constant string literals of host element attributes.
## Example
Suppose we have an `` element and want to know its `type`.
```html
```
A decorator can inject string literal `text` like so:
```javascript
@Decorator({
selector: `input'
})
class InputDecorator {
constructor(@Attribute('type') type) {
// type would be `text` in this example
}
}
```
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
(attributeName)
:markdown
.l-sub-section
h3 attributeName
:markdown
.l-sub-section
h3 token
:markdown