Last active
May 20, 2020 18:07
-
-
Save riscie/05b9511dd0e61aef1228ba4f7ac6fd71 to your computer and use it in GitHub Desktop.
ngOnChanges with SimpleChanges hook #angular #typescript
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
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