Angular ngx烤面包片,烤面包片不呈棱角状
我正在使用Angular开发一个web应用程序,我想包括ngx toastr来向用户发送通知,但它并没有按预期工作。当我触发祝酒词时,什么也没发生我的代码在下面请有人帮帮我请告诉我我做错了什么Angular ngx烤面包片,烤面包片不呈棱角状,angular,toastr,Angular,Toastr,我正在使用Angular开发一个web应用程序,我想包括ngx toastr来向用户发送通知,但它并没有按预期工作。当我触发祝酒词时,什么也没发生我的代码在下面请有人帮帮我请告诉我我做错了什么 export class AppComponent { constructor( private toast: ToastrService, ) { } test() { this.toast.success("I'm a toast!", "Success!"); }
export class AppComponent {
constructor(
private toast: ToastrService,
) { }
test() {
this.toast.success("I'm a toast!", "Success!");
}
}
您没有添加吐司所需的
css
添加angular.json的样式数组,如下所示
"styles": [
"src/styles.css",
"node_modules/ngx-toastr/toastr.css"
],
查看此处更新的样式。css add
@import "toastr";
当我点击maketoast
按钮时,我可以看到祝酒词。只是它在大约一秒钟内消失了,但我想显示右下角的成功背景请看我的答案