export class AttributeMetadata
export class AttributeMetadata
exported from angular2/core defined in angular2/src/core/metadata/di.ts (line 3)
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 <input>
element and want to know its type
.
<input type="text">
A decorator can inject string literal text
like so:
@Directive({selector: 'input'})
class InputAttrDirective {
constructor(@Attribute('type') type) {
// type would be 'text' in this example
}
}
Constructor
constructor(attributeName: string)
constructor(attributeName: string)
Not Yet Documented
Members
attributeName : string
attributeName : string
Not Yet Documented
token : AttributeMetadata
token : AttributeMetadata
Not Yet Documented
toString() : string
toString() : string
Not Yet Documented