I am working on this angular2 app in which I am accepting two inputs in one component.
I have used ngOnChanges to detect changes on these input values.
@Input() games: any;
@Input() selectedGame:any;
ngOnChanges(changes: {[propName: string]: SimpleChange}) {
this.selectedGame=changes['selectedGame'].currentValue; //this works
this.games=changes['games'].currentValue; //this doesn't work
}
However, I can only detect change in first variable. the second variable is not getting updated when its value changes in parent.
any inputs?