ComponentFactory

export interface ComponentFactory

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

ComponentMetadata factory for creating annotations, decorators or DSL.

Example as TypeScript Decorator

@Component({selector: 'greet', template: 'Hello {{name}}!', directives: [CustomDirective]}) class Greet { name: string = 'World'; }

Example as ES5 DSL

var MyComponent = ng .Component({...}) .Class({ constructor: function() { ... } })

Example as ES5 annotation

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

MyComponent.annotations = [
  new ng.Component({...})
]