Angular - Lifecycle Hooks
Given this Angular component snippet:
What will be the content of
export class MyComponent implements OnChanges {
@Input() count = 0;
changesLog: string[] = [];
ngOnChanges(changes: SimpleChanges) {
if (changes['count']) {
this.changesLog.push(`Count changed from ${changes['count'].previousValue} to ${changes['count'].currentValue}`);
}
}
}What will be the content of
changesLog after the input count changes from 5 to 10?