扫码关注官方订阅号
@Component({ }) export class App implements OnInit { }
请问implements OnInit这两个词是什么东西?
implements OnInit
对于implements完全没概念,网上找的教程似乎也没有提及……
OnInit是钩子函数吗?意思在渲染这个组件的时候就执行?
求教,谢谢!
光阴似箭催人老,日月如移越少年。
两点:
implements 表示接口实现,这是typescript的东西,所以你搜索的姿势不对【typescript implements】。
implements
OnInit 的确是生命周期钩子,这是Angular的东西,见:https://angular.cn/docs/ts/la...。
OnInit
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
两点:
implements表示接口实现,这是typescript的东西,所以你搜索的姿势不对【typescript implements】。OnInit的确是生命周期钩子,这是Angular的东西,见:https://angular.cn/docs/ts/la...。