Skip to content

Commit dcc4bc2

Browse files
committed
fix(annotations): swap DirectiveArgs & ComponentArgs
1 parent 5dee8e2 commit dcc4bc2

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

modules/angular2/src/core/annotations/decorators.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ export interface ComponentTypeDecorator extends TypeDecorator {
2424
export interface ViewTypeDecorator extends TypeDecorator { View(obj: ViewArgs): ViewTypeDecorator }
2525

2626
export interface Directive {
27-
(obj: any): DirectiveTypeDecorator;
27+
(obj: DirectiveArgs): DirectiveTypeDecorator;
2828
new (obj: DirectiveAnnotation): DirectiveAnnotation;
2929
}
3030

3131
export interface Component {
32-
(obj: any): ComponentTypeDecorator;
32+
(obj: ComponentArgs): ComponentTypeDecorator;
3333
new (obj: ComponentAnnotation): ComponentAnnotation;
3434
}
3535

modules/angular2/src/core/annotations_impl/annotations.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ export class Directive extends Injectable {
787787
constructor({
788788
selector, properties, events, host, lifecycle, hostInjector, exportAs,
789789
compileChildren = true,
790-
}: ComponentArgs = {}) {
790+
}: DirectiveArgs = {}) {
791791
super();
792792
this.selector = selector;
793793
this.properties = properties;
@@ -800,7 +800,7 @@ export class Directive extends Injectable {
800800
}
801801
}
802802

803-
export interface ComponentArgs {
803+
export interface DirectiveArgs {
804804
selector?: string;
805805
properties?: List<string>;
806806
events?: List<string>;
@@ -962,7 +962,7 @@ export class Component extends Directive {
962962

963963
constructor({selector, properties, events, host, exportAs, appInjector, lifecycle, hostInjector,
964964
viewInjector, changeDetection = DEFAULT,
965-
compileChildren = true}: DirectiveArgs = {}) {
965+
compileChildren = true}: ComponentArgs = {}) {
966966
super({
967967
selector: selector,
968968
properties: properties,
@@ -979,21 +979,13 @@ export class Component extends Directive {
979979
this.viewInjector = viewInjector;
980980
}
981981
}
982-
export interface DirectiveArgs {
983-
selector?: string;
984-
properties?: List<string>;
985-
events?: List<string>;
986-
host?: StringMap<string, string>;
987-
exportAs?: string;
982+
983+
export interface ComponentArgs extends DirectiveArgs {
988984
appInjector?: List<any>;
989-
lifecycle?: List<LifecycleEvent>;
990-
hostInjector?: List<any>;
991985
viewInjector?: List<any>;
992986
changeDetection?: string;
993-
compileChildren?: boolean;
994987
}
995988

996-
997989
/**
998990
* Lifecycle events are guaranteed to be called in the following order:
999991
* - `onChange` (optional if any bindings have changed),

0 commit comments

Comments
 (0)