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]', selector: '[ng-control-group]',
hostInjector: [controlGroupBinding], hostInjector: [controlGroupBinding],
properties: ['name: ng-control-group'], properties: ['name: ng-control-group'],
lifecycle: [onInit, onDestroy] lifecycle: [onInit, onDestroy],
exportAs: 'form'
}) })
export class ControlGroupDirective extends ControlContainerDirective { export class ControlGroupDirective extends ControlContainerDirective {
_parent: ControlContainerDirective; _parent: ControlContainerDirective;

View File

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

View File

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

View File

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

View File

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

View File

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