码迷,mamicode.com
首页 > 其他好文 > 详细

[Angular] Two things about OnChanges Lifecycle hook

时间:2019-01-29 20:49:31      阅读:189      评论:0      收藏:0      [点我收藏+]

标签:for   cal   enc   called   put   angular   inpu   obj   life   

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.

[Angular] Two things about OnChanges Lifecycle hook

标签:for   cal   enc   called   put   angular   inpu   obj   life   

原文地址:https://www.cnblogs.com/Answer1215/p/10335507.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!