X Tutup
Skip to content

Commit e7e82cb

Browse files
committed
feat(forms): set exportAs to form for all form related directives
1 parent 73bce40 commit e7e82cb

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

modules/angular2/src/forms/directives/control_group_directive.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ const controlGroupBinding = CONST_EXPR(
5858
selector: '[ng-control-group]',
5959
hostInjector: [controlGroupBinding],
6060
properties: ['name: ng-control-group'],
61-
lifecycle: [onInit, onDestroy]
61+
lifecycle: [onInit, onDestroy],
62+
exportAs: 'form'
6263
})
6364
export class ControlGroupDirective extends ControlContainerDirective {
6465
_parent: ControlContainerDirective;

modules/angular2/src/forms/directives/control_name_directive.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ const controlNameBinding =
6060
hostInjector: [controlNameBinding],
6161
properties: ['name: ng-control', 'model: ng-model'],
6262
events: ['ngModel'],
63-
lifecycle: [onDestroy, onChange]
63+
lifecycle: [onDestroy, onChange],
64+
exportAs: 'form'
6465
})
6566
export class ControlNameDirective extends ControlDirective {
6667
_parent: ControlContainerDirective;

modules/angular2/src/forms/directives/form_control_directive.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ const formControlBinding =
4949
hostInjector: [formControlBinding],
5050
properties: ['form: ng-form-control', 'model: ng-model'],
5151
events: ['ngModel'],
52-
lifecycle: [onChange]
52+
lifecycle: [onChange],
53+
exportAs: 'form'
5354
})
5455
export class FormControlDirective extends ControlDirective {
5556
form: Control;

modules/angular2/src/forms/directives/form_model_directive.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ const formDirectiveBinding = CONST_EXPR(
6363
hostListeners: {
6464
'submit': 'onSubmit()',
6565
},
66-
events: ['ngSubmit']
66+
events: ['ngSubmit'],
67+
exportAs: 'form'
6768
})
6869
export class FormModelDirective extends ControlContainerDirective implements FormDirective {
6970
form: ControlGroup = null;

modules/angular2/src/forms/directives/ng_model_directive.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ const formControlBinding =
1717
hostInjector: [formControlBinding],
1818
properties: ['model: ng-model'],
1919
events: ['ngModel'],
20-
lifecycle: [onChange]
20+
lifecycle: [onChange],
21+
exportAs: 'form'
2122
})
2223
export class NgModelDirective extends ControlDirective {
2324
control: Control;

modules/angular2/src/forms/directives/template_driven_form_directive.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ const formDirectiveBinding = CONST_EXPR(new Binding(
1919
hostListeners: {
2020
'submit': 'onSubmit()',
2121
},
22-
events: ['ngSubmit']
22+
events: ['ngSubmit'],
23+
exportAs: 'form'
2324
})
2425
export class TemplateDrivenFormDirective extends ControlContainerDirective implements
2526
FormDirective {

0 commit comments

Comments
 (0)
X Tutup