Skip to content

Instantly share code, notes, and snippets.

@ssougnez
Last active February 28, 2021 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssougnez/2f775cecc0cf59625c1cfa21675d08b4 to your computer and use it in GitHub Desktop.
Save ssougnez/2f775cecc0cf59625c1cfa21675d08b4 to your computer and use it in GitHub Desktop.
constructor(private _cdr: ChangeDetectorRef) { }
public switch(value: boolean) {
if (value !== this.value && this.disabled === false) {
this._value = value;
this.change.emit(this.value);
if (this.onChange) {
this.onChange(this.value);
}
this._cdr.markForCheck();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment