mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
fix(demo): respond to custom events
This commit is contained in:
@ -16,4 +16,12 @@ export class InputsPage {
|
||||
getIonicTextInputOutputText() {
|
||||
return element(by.id('ionTextInputOutput')).getText();
|
||||
}
|
||||
|
||||
getIonicCheckbox() {
|
||||
return element(by.id('ionCheckbox'));
|
||||
}
|
||||
|
||||
getIonicCheckboxOutputText() {
|
||||
return element(by.id('ionCheckboxOutput')).getText();
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<ion-input id="ionTextInput" name="ionTextInput" [(ngModel)]="ionTextInput" (change)="change($event)" (blur)="onBlur($event)"></ion-input>
|
||||
<ion-input id="ionTextInput" name="ionTextInput" [(ngModel)]="ionTextInput" (change)="change($event)" (ionBlur)="onBlur($event)"></ion-input>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
Entered Data: <span id="ionTextInputOutput">{{ionTextInput}}</span>
|
||||
@ -29,7 +29,7 @@
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<ion-checkbox id="ionCheckbox" name="ionCheckbox" [(ngModel)]="ionCheckbox" (change)="change($event)" (blur)="onBlur($event)"></ion-checkbox>
|
||||
<ion-checkbox id="ionCheckbox" name="ionCheckbox" [(ngModel)]="ionCheckbox" (ionChange)="change($event)" (blur)="onBlur($event)"></ion-checkbox>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
Entered Data: <span id="ionCheckboxOutput">{{ionCheckbox}}</span>
|
||||
|
||||
@ -19,7 +19,7 @@ export class IonCheckboxValueAccessorDirective implements ControlValueAccessor {
|
||||
this.renderer.setProperty(this.element.nativeElement, 'checked', value);
|
||||
}
|
||||
|
||||
@HostListener('change', ['$event.target.checked'])
|
||||
@HostListener('ionChange', ['$event.target.checked'])
|
||||
_handleIonChange(value: any) {
|
||||
this.onChange(value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user