feat(demo): make our value accessors more closely match Angular's

This commit is contained in:
Ken Sodemann
2017-11-16 09:40:45 -06:00
parent e50d7fbfe4
commit c23e2f717c
7 changed files with 49 additions and 14 deletions

View File

@ -16,13 +16,11 @@ export class IonCheckboxValueAccessorDirective implements ControlValueAccessor {
onTouched: () => void;
writeValue(value: any) {
console.log('writeValue', value);
this.renderer.setProperty(this.element.nativeElement, 'checked', value);
}
@HostListener('change', ['$event.target.checked'])
_handleIonChange(value: any) {
console.log('handle change', value);
this.onChange(value);
}