Skip to content

Instantly share code, notes, and snippets.

@riscie
Last active May 20, 2020 18:07
Show Gist options
  • Save riscie/05b9511dd0e61aef1228ba4f7ac6fd71 to your computer and use it in GitHub Desktop.
Save riscie/05b9511dd0e61aef1228ba4f7ac6fd71 to your computer and use it in GitHub Desktop.
ngOnChanges with SimpleChanges hook #angular #typescript
ngOnChanges(changes: SimpleChanges): void {
for (const property in changes) {
if (changes.hasOwnProperty(property)) {
switch (property) {
case 'someInputName': {
// do something
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment