akveo/ng2-admin - CSS 未考虑的 ng2-toastr
ng2-toastr with akveo/ng2-admin - CSS not taken into account
我正在使用 akveo/ng2-admin 仪表板(最新的 angular 4)并尝试按照安装文档使用 ng2-toastr。
我在 index.html 文件中导入了 CSS 并在 app.module.ts 文件中声明了 ToastModule。
我还在我的组件中导入了 ToastsManager 并分配了 ViewContainerRef。
模块加载成功,到目前为止一切正常。
但是当我调用 this.toastr.success('You are awesome!', 'Success!');
时,文本显示时没有使用 CSS。
ng2-admin 正在使用 WebPack。
有什么想法吗?
提前致谢!
哔叽.
URL烤面包机:https://github.com/PointInside/ng2-toastr
URL ng2-admin: enter link description here
我复制了 theme 文件夹中的 CSS 文件,并使用以下命令将其加载到 app.component.ts 中:
import 'style-loader!./theme/ng2-toastr/ng2-toastr.scss';
干杯,
哔叽.
添加
@import '../node_modules/ng2-toastr/ng2-toastr.css';
到./src/app/theme/theme.cscc
这个文件是用来添加全局样式或导入其他文件的,这样我们就可以避免复制文件
我正在使用 akveo/ng2-admin 仪表板(最新的 angular 4)并尝试按照安装文档使用 ng2-toastr。
我在 index.html 文件中导入了 CSS 并在 app.module.ts 文件中声明了 ToastModule。
我还在我的组件中导入了 ToastsManager 并分配了 ViewContainerRef。
模块加载成功,到目前为止一切正常。
但是当我调用 this.toastr.success('You are awesome!', 'Success!');
时,文本显示时没有使用 CSS。
ng2-admin 正在使用 WebPack。
有什么想法吗?
提前致谢! 哔叽.
URL烤面包机:https://github.com/PointInside/ng2-toastr
URL ng2-admin: enter link description here
我复制了 theme 文件夹中的 CSS 文件,并使用以下命令将其加载到 app.component.ts 中:
import 'style-loader!./theme/ng2-toastr/ng2-toastr.scss';
干杯, 哔叽.
添加
@import '../node_modules/ng2-toastr/ng2-toastr.css';
到./src/app/theme/theme.cscc
这个文件是用来添加全局样式或导入其他文件的,这样我们就可以避免复制文件