fix(toggle): use value accessor provider

Remove the value property and always recommend ngModel or ngControl.
Closes #5425
This commit is contained in:
Adam Bradley
2016-02-13 00:32:08 -06:00
parent dafa400230
commit 5034c1d729
3 changed files with 109 additions and 113 deletions

View File

@@ -15,6 +15,12 @@ import {
templateUrl: 'main.html'
})
class E2EApp {
fruitsForm: ControlGroup;
grapeDisabled: boolean;
kiwiModel: boolean;
strawberryModel: boolean;
formResults: string;
constructor() {
this.fruitsForm = new ControlGroup({
"appleCtrl": new Control(),
@@ -24,13 +30,13 @@ class E2EApp {
});
this.grapeDisabled = true;
this.grapeChecked = true;
this.myModel = true;
this.kiwiModel = false;
this.strawberryModel = true;
}
toggleGrapeChecked() {
this.grapeChecked = !this.grapeChecked;
this.fruitsForm.controls['grapeCtrl'].updateValue( !this.fruitsForm.controls['grapeCtrl'].value )
}
toggleGrapeDisabled() {