angular5给懒加载模块添加loading
在根组件的构造函数中直接执行:
this.router.events.subscribe(event=>{if(event instanceof RouteConfigLoadEnd) {this.toast.hide();}if(event instanceof RouteConfigLoadStart) {this.toast.loading();}});
posted @ -01-22 22:36 黑客PK 阅读( ...) 评论( ...) 编辑 收藏