diff --git a/modules/angular2/src/core/annotations/decorators.ts b/modules/angular2/src/core/annotations/decorators.ts index 3928b784e0..4dc0cec846 100644 --- a/modules/angular2/src/core/annotations/decorators.ts +++ b/modules/angular2/src/core/annotations/decorators.ts @@ -24,12 +24,12 @@ export interface ComponentTypeDecorator extends TypeDecorator { export interface ViewTypeDecorator extends TypeDecorator { View(obj: ViewArgs): ViewTypeDecorator } export interface Directive { - (obj: any): DirectiveTypeDecorator; + (obj: DirectiveArgs): DirectiveTypeDecorator; new (obj: DirectiveAnnotation): DirectiveAnnotation; } export interface Component { - (obj: any): ComponentTypeDecorator; + (obj: ComponentArgs): ComponentTypeDecorator; new (obj: ComponentAnnotation): ComponentAnnotation; } diff --git a/modules/angular2/src/core/annotations_impl/annotations.ts b/modules/angular2/src/core/annotations_impl/annotations.ts index 488db050e5..952b4b7e52 100644 --- a/modules/angular2/src/core/annotations_impl/annotations.ts +++ b/modules/angular2/src/core/annotations_impl/annotations.ts @@ -787,7 +787,7 @@ export class Directive extends Injectable { constructor({ selector, properties, events, host, lifecycle, hostInjector, exportAs, compileChildren = true, - }: ComponentArgs = {}) { + }: DirectiveArgs = {}) { super(); this.selector = selector; this.properties = properties; @@ -800,7 +800,7 @@ export class Directive extends Injectable { } } -export interface ComponentArgs { +export interface DirectiveArgs { selector?: string; properties?: List; events?: List; @@ -962,7 +962,7 @@ export class Component extends Directive { constructor({selector, properties, events, host, exportAs, appInjector, lifecycle, hostInjector, viewInjector, changeDetection = DEFAULT, - compileChildren = true}: DirectiveArgs = {}) { + compileChildren = true}: ComponentArgs = {}) { super({ selector: selector, properties: properties, @@ -979,21 +979,13 @@ export class Component extends Directive { this.viewInjector = viewInjector; } } -export interface DirectiveArgs { - selector?: string; - properties?: List; - events?: List; - host?: StringMap; - exportAs?: string; + +export interface ComponentArgs extends DirectiveArgs { appInjector?: List; - lifecycle?: List; - hostInjector?: List; viewInjector?: List; changeDetection?: string; - compileChildren?: boolean; } - /** * Lifecycle events are guaranteed to be called in the following order: * - `onChange` (optional if any bindings have changed),