Skip to content

Instantly share code, notes, and snippets.

@brachi-wernick
Created December 28, 2017 17:10
Show Gist options
  • Save brachi-wernick/7feb3906c9650379380c9e75bb2da105 to your computer and use it in GitHub Desktop.
Save brachi-wernick/7feb3906c9650379380c9e75bb2da105 to your computer and use it in GitHub Desktop.
fire validation changed when input has changed
registerOnValidatorChange(fn: () => void): void { this._onChange = fn; }
private _onChange: () => void;
ngOnChanges(changes: SimpleChanges): void {
if ('requiredIf' in changes) {
if (this._onChange) this._onChange();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment