【问题标题】:ng-snotify, No notification appears on route changeng-snotify,路由更改时不显示通知
【发布时间】:2018-02-26 06:45:05
【问题描述】:

this.snotifyService.success('用户已通过身份验证', '登录成功', { 超时:2000, 显示进度条:假, 关闭点击:假, pauseOnHover: 真 }); this.router.navigate(['omanCargo/home']);

当我在触发成功消息后更改路线时,如图所示,没有任何显示。 任何帮助将不胜感激,我是 angular 4 的新手

【问题讨论】:

标签: angularjs typescript notifications react-router


【解决方案1】:

您是否在某处导入了 CSS? 您应该像这样在全局 style.scss 中导入其中一个

@import "~ng-snotify/styles/material"; 

@import "~ng-snotify/styles/material.css"; 

如果你使用 css 语法。

如果你使用 css 语法和 angular-cli。直接在 .angular-cli.json 中导入样式

{
  "styles": [
          "../node_modules/ng-snotify/styles/{STYLE_NAME}.css",
          "styles.css"
  ]
}

另外确保你放了

<ng-snotify></ng-snotify>

在你的应用程序根附近的某个地方,我把我的放在我的 home.component.ts 中

【讨论】:

    猜你喜欢
    • 2018-06-12
    • 2017-02-03
    • 1970-01-01
    • 2021-01-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多