refactor(forms): rename decorators into directives
This commit is contained in:
2
modules/angular2/forms.js
vendored
2
modules/angular2/forms.js
vendored
@ -1,2 +1,2 @@
|
|||||||
export * from './src/forms/model';
|
export * from './src/forms/model';
|
||||||
export * from './src/forms/decorators';
|
export * from './src/forms/directives';
|
||||||
|
@ -4,6 +4,11 @@ import {isBlank, isPresent} from 'angular2/src/facade/lang';
|
|||||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
import {ListWrapper} from 'angular2/src/facade/collection';
|
||||||
import {ControlGroup, Control} from './model';
|
import {ControlGroup, Control} from './model';
|
||||||
|
|
||||||
|
class ControlGroupDirectiveBase {
|
||||||
|
addDirective(directive):void {}
|
||||||
|
findControl(name:string):Control { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
export class ControlDirectiveBase {
|
export class ControlDirectiveBase {
|
||||||
_groupDecorator:ControlGroupDirectiveBase;
|
_groupDecorator:ControlGroupDirectiveBase;
|
||||||
_el:NgElement;
|
_el:NgElement;
|
||||||
@ -48,11 +53,6 @@ export class ControlDirectiveBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ControlGroupDirectiveBase {
|
|
||||||
addDirective(c:ControlNameDirective):void {}
|
|
||||||
findControl(name:string):Control {}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Decorator({
|
@Decorator({
|
||||||
selector: '[control-name]',
|
selector: '[control-name]',
|
||||||
@ -61,13 +61,9 @@ class ControlGroupDirectiveBase {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
export class ControlNameDirective extends ControlDirectiveBase {
|
export class ControlNameDirective extends ControlDirectiveBase {
|
||||||
_groupDecorator:ControlGroupDirective;
|
|
||||||
_el:NgElement;
|
|
||||||
_controlName:String;
|
|
||||||
|
|
||||||
constructor(@Ancestor() groupDecorator:ControlGroupDirective, el:NgElement) {
|
constructor(@Ancestor() groupDecorator:ControlGroupDirective, el:NgElement) {
|
||||||
super(groupDecorator, el);
|
super(groupDecorator, el);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Decorator({
|
@Decorator({
|
||||||
@ -77,13 +73,9 @@ export class ControlNameDirective extends ControlDirectiveBase {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
export class ControlDirective extends ControlDirectiveBase {
|
export class ControlDirective extends ControlDirectiveBase {
|
||||||
_groupDecorator:ControlGroupDirective;
|
|
||||||
_el:NgElement;
|
|
||||||
_controlName:String;
|
|
||||||
|
|
||||||
constructor(@Ancestor() groupDecorator:NewControlGroupDirective, el:NgElement) {
|
constructor(@Ancestor() groupDecorator:NewControlGroupDirective, el:NgElement) {
|
||||||
super(groupDecorator, el);
|
super(groupDecorator, el);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Decorator({
|
@Decorator({
|
Reference in New Issue
Block a user