ngx-toastr, Toast not showing in Angular 7

后端 未结 16 1736
清歌不尽
清歌不尽 2021-02-01 12:37

I\'m currently developing a web app using Angular 7. I wanted to include ngx-toastr to send notifications to users but it isn\'t working as expected. When I trigger a toast noth

16条回答
  •  面向向阳花
    2021-02-01 13:09

    I came across this issue again. The resources above said it was fixed but not for me. Even after getting the latest resources for both bootstrap and toastr. After much investigations I found that simply adding '!important' to the relevant toastr alert type backgrounds resolved this for me. See code below.

    .toast-success{background-color:#51A351!important;}
    .toast-error{background-color:#BD362F!important;}
    .toast-info{background-color:#2F96B4!important;}
    .toast-warning{background-color:#F89406!important;}
    

    Although not good practice, I added the code the .min.css file. We do however host these files in our AWS CloudFront CDN and there is no need for duplicate CDN's.

提交回复
热议问题