ngx-toastr, Toast not showing in Angular 7

后端 未结 16 1697
清歌不尽
清歌不尽 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:07

    Even after adding the opacity css code from the above answers in my global style.scss, it did not solve my problem entirely; I was getting a blank white box.

    After adding the additional css mentioned in this GitHub post, the toasts are working correctly.

    The relevant code from the above post is below:

    /* TOASTR BUGFIX */
    #toast-container > div {
      opacity: 1;
    }
    .toast {
      font-size: initial !important;
      border: initial !important;
      backdrop-filter: blur(0) !important;
    }
    .toast-success {
      background-color: #51A351 !important;
    }
    .toast-error {
      background-color: #BD362F !important;
    }
    .toast-info {
      background-color: #2F96B4 !important;
    }
    .toast-warning {
      background-color: #F89406 !important;
    }
    

提交回复
热议问题