feat(forms): add support for standalone ngModel dirs inside forms

Closes #9230
This commit is contained in:
Kara Erickson
2016-06-23 09:55:26 -07:00
parent 826f89f862
commit 6edf0474cc
6 changed files with 68 additions and 25 deletions

View File

@ -144,12 +144,11 @@ export class FormGroupDirective extends ControlContainer implements Form,
get path(): string[] { return []; }
addControl(dir: NgControl): FormControl {
addControl(dir: NgControl): void {
const ctrl: any = this.form.find(dir.path);
setUpControl(ctrl, dir);
ctrl.updateValueAndValidity({emitEvent: false});
this.directives.push(dir);
return ctrl;
}
getControl(dir: NgControl): FormControl { return <FormControl>this.form.find(dir.path); }