【问题标题】:angular2-busy not showing animations - Angular 4angular2-busy 不显示动画 - Angular 4
【发布时间】:2017-07-21 05:55:53
【问题描述】:

我在 Angular 4 项目中使用 angular2-busy。当我使用 ngBusy 指令时,我只收到默认消息,没有包含背景的动画。我在index.html 中导入busy.css 文件并同时导入BusyModuleBroswerAnimationModule

这是我的使用方法:

 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


【解决方案1】:

我最终只是手动将样式复制到我的全局 styles.css 文件中。不理想,但它有效。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-02-25
    • 1970-01-01
    • 2017-12-25
    • 2017-06-26
    • 2018-08-29
    • 1970-01-01
    • 2018-04-28
    • 1970-01-01
    相关资源
    最近更新 更多