AttributeFactory

export interface AttributeFactory

exported from angular2/core defined in angular2/src/core/metadata.ts (line 310)

AttributeMetadata factory for creating annotations, decorators or DSL.

Example as TypeScript Decorator

@Component({selector: 'page', template: 'Title: {{title}}'}) class Page { title: string; constructor(@Attribute('title') title: string) { this.title = title; } }

Example as ES5 DSL

var MyComponent = ng .Component({...}) .Class({ constructor: [new ng.Attribute('title'), function(title) { ... }] })

Example as ES5 annotation

var MyComponent = function(title) {
  ...
};

MyComponent.annotations = [
  new ng.Component({...})
]
MyComponent.parameters = [
  [new ng.Attribute('title')]
]