Skip to content

Commit e9a254a

Browse files
committed
refactor(forms): rename decorators into directives
1 parent 640134d commit e9a254a

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

modules/angular2/forms.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export * from './src/forms/model';
2-
export * from './src/forms/decorators';
2+
export * from './src/forms/directives';

modules/angular2/src/forms/decorators.js renamed to modules/angular2/src/forms/directives.js

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import {isBlank, isPresent} from 'angular2/src/facade/lang';
44
import {ListWrapper} from 'angular2/src/facade/collection';
55
import {ControlGroup, Control} from './model';
66

7+
class ControlGroupDirectiveBase {
8+
addDirective(directive):void {}
9+
findControl(name:string):Control { return null; }
10+
}
11+
712
export class ControlDirectiveBase {
813
_groupDecorator:ControlGroupDirectiveBase;
914
_el:NgElement;
@@ -48,11 +53,6 @@ export class ControlDirectiveBase {
4853
}
4954
}
5055

51-
class ControlGroupDirectiveBase {
52-
addDirective(c:ControlNameDirective):void {}
53-
findControl(name:string):Control {}
54-
}
55-
5656

5757
@Decorator({
5858
selector: '[control-name]',
@@ -61,13 +61,9 @@ class ControlGroupDirectiveBase {
6161
}
6262
})
6363
export class ControlNameDirective extends ControlDirectiveBase {
64-
_groupDecorator:ControlGroupDirective;
65-
_el:NgElement;
66-
_controlName:String;
67-
6864
constructor(@Ancestor() groupDecorator:ControlGroupDirective, el:NgElement) {
69-
super(groupDecorator, el);
70-
}
65+
super(groupDecorator, el);
66+
}
7167
}
7268

7369
@Decorator({
@@ -77,13 +73,9 @@ export class ControlNameDirective extends ControlDirectiveBase {
7773
}
7874
})
7975
export class ControlDirective extends ControlDirectiveBase {
80-
_groupDecorator:ControlGroupDirective;
81-
_el:NgElement;
82-
_controlName:String;
83-
8476
constructor(@Ancestor() groupDecorator:NewControlGroupDirective, el:NgElement) {
85-
super(groupDecorator, el);
86-
}
77+
super(groupDecorator, el);
78+
}
8779
}
8880

8981
@Decorator({

0 commit comments

Comments
 (0)