Last active
February 28, 2021 16:25
-
-
Save ssougnez/2f775cecc0cf59625c1cfa21675d08b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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