mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(toggle): use value accessor provider
Remove the value property and always recommend ngModel or ngControl. Closes #5425
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user