feat(forms): set exportAs to form for all form related directives

This commit is contained in:
vsavkin 2015-06-05 14:33:57 -07:00
parent 73bce40287
commit e7e82cbee6
6 changed files with 12 additions and 6 deletions

View File

@ -58,7 +58,8 @@ const controlGroupBinding = CONST_EXPR(
selector: '[ng-control-group]',
hostInjector: [controlGroupBinding],
properties: ['name: ng-control-group'],
lifecycle: [onInit, onDestroy]
lifecycle: [onInit, onDestroy],
exportAs: 'form'
})
export class ControlGroupDirective extends ControlContainerDirective {
_parent: ControlContainerDirective;

View File

@ -60,7 +60,8 @@ const controlNameBinding =
hostInjector: [controlNameBinding],
properties: ['name: ng-control', 'model: ng-model'],
events: ['ngModel'],
lifecycle: [onDestroy, onChange]
lifecycle: [onDestroy, onChange],
exportAs: 'form'
})
export class ControlNameDirective extends ControlDirective {
_parent: ControlContainerDirective;

View File

@ -49,7 +49,8 @@ const formControlBinding =
hostInjector: [formControlBinding],
properties: ['form: ng-form-control', 'model: ng-model'],
events: ['ngModel'],
lifecycle: [onChange]
lifecycle: [onChange],
exportAs: 'form'
})
export class FormControlDirective extends ControlDirective {
form: Control;

View File

@ -63,7 +63,8 @@ const formDirectiveBinding = CONST_EXPR(
hostListeners: {
'submit': 'onSubmit()',
},
events: ['ngSubmit']
events: ['ngSubmit'],
exportAs: 'form'
})
export class FormModelDirective extends ControlContainerDirective implements FormDirective {
form: ControlGroup = null;

View File

@ -17,7 +17,8 @@ const formControlBinding =
hostInjector: [formControlBinding],
properties: ['model: ng-model'],
events: ['ngModel'],
lifecycle: [onChange]
lifecycle: [onChange],
exportAs: 'form'
})
export class NgModelDirective extends ControlDirective {
control: Control;

View File

@ -19,7 +19,8 @@ const formDirectiveBinding = CONST_EXPR(new Binding(
hostListeners: {
'submit': 'onSubmit()',
},
events: ['ngSubmit']
events: ['ngSubmit'],
exportAs: 'form'
})
export class TemplateDrivenFormDirective extends ControlContainerDirective implements
FormDirective {