ngOnInit 在refreshView里,ngOnInit当成是PreOrderHooks来执行: 而ngAfterViewInit的调用时机:在ngOnInit之后,注释里写得比较清楚。 更多Jerry的原创文章,尽在:“汪子熙”:... 查看原文 Angular生命周期钩子执行顺序 ,暴露给你,赋予你在它们发生时采取行动的能力。 生命周期钩子的执行顺序 钩子 用途时机ngOnChanges(...
Onchanges, if Angular detects any changes to the Input property. It runs every time angular detects an input change. OnInit, which tells us that the component is ready. This hook gives us a chance to run any initialization logic, updates a few properties, etc. This hook runs o...