【发布时间】:2017-07-21 05:55:53
【问题描述】:
我在 Angular 4 项目中使用 angular2-busy。当我使用 ngBusy 指令时,我只收到默认消息,没有包含背景的动画。我在index.html 中导入busy.css 文件并同时导入BusyModule 和BroswerAnimationModule。
这是我的使用方法:
this.busy = this.route.paramMap.switchMap((params: ParamMap) =>
this.httpService.getEventHistory(+params.get('site_no')))
.subscribe(events => {this.events = events});
我不知道这是否相关,但即使在数据加载后,“请稍候”消息仍保留在屏幕上。
编辑:我将 CSS 链接从 index.html 文件移动到 .angular-cli.json 文件下的 styles。我仍然面临同样的问题。
这是我尝试使用的包: https://www.npmjs.com/package/angular2-busy
【问题讨论】:
-
我不太确定你在做什么,而且我之前没有使用过这个库,但我的猜测是
this.route部分导致了问题。尝试为更基本的订阅显示忙碌指示符。 -
我在基本订阅上试过了,我没有挂起问题,但它仍然没有显示任何动画。
标签: css angular angular-animations