mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 11:17:19 +08:00

committed by
Manu MA

parent
359bdcf8ec
commit
b645bfd1b7
@ -1,7 +1,7 @@
|
||||
import { Directive, ElementRef, HostListener } from '@angular/core';
|
||||
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
||||
|
||||
import { ValueAccessor } from './value-accessor';
|
||||
import { ValueAccessor, setIonicClasses } from './value-accessor';
|
||||
|
||||
@Directive({
|
||||
/* tslint:disable-next-line:directive-selector */
|
||||
@ -20,6 +20,11 @@ export class BooleanValueAccessor extends ValueAccessor {
|
||||
super(el);
|
||||
}
|
||||
|
||||
writeValue(value: any) {
|
||||
this.el.nativeElement.checked = this.lastValue = value == null ? '' : value;
|
||||
setIonicClasses(this.el);
|
||||
}
|
||||
|
||||
@HostListener('ionChange', ['$event.target.checked'])
|
||||
_handleIonChange(value: any) {
|
||||
this.handleChangeEvent(value);
|
||||
|
Reference in New Issue
Block a user