I am currently utilizing Angular 2.
At the moment, I have two @input variables named aa
and bb
. My objective is:
- When
aa
changes, perform a specific action. - When
bb
changes, execute a different action.
How can I identify which @Input has changed within the ngOnChanges
method? Thank you
@Input() aa;
@Input() bb;
ngOnChanges(changes: { [propName: string]: SimpleChange }) {
// if aa changes, do something
// if bb changes, do other thing
}