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.

  1. <input type="text">

A decorator can inject string literal text like so:

  1. @Directive({selector: 'input'})
  2. class InputAttrDirective {
  3. constructor(@Attribute('type') type) {
  4. // type would be 'text' in this example
  5. }
  6. }

Constructor

constructor(attributeName: string)

Not Yet Documented

Members

attributeName : string

Not Yet Documented

token : AttributeMetadata

Not Yet Documented

toString() : string

Not Yet Documented