Your application can take action at each moment in this lifecycle through optional lifecycle hooks, like ngOnInit (). 当用户在应用中穿行时,Angular 就会创建、更新、销毁一些组件。 你的应用可以通过一些可选的 生命周期钩子 (比如 ngOnInit ...