[Angular] Two things about OnChanges Lifecycle hook

1. ngOnChanges is called before ngOnInit but after constructor()

2. ngOnChanges is called because of @Input() obj, obj's reference changes. If you mutate one the object's prop, it won't trigger ngOnChanges, you have to create new object.

posted @ 2019-01-29 18:56  Zhentiw  阅读(183)  评论(0编辑  收藏  举报