angularjs 如何在显示新的toastr之前清除上一个toastr并在它们之间设置超时?

lnxxn5zx  于 2022-12-10  发布在  Angular
关注(0)|答案(3)|浏览(158)

I am using Angular toastr and I am stuck at passing a delay between hiding the previous toastr and showing the next one. There should be only one toastr at a time. I am hiding and showing it, but there is no visual difference, and still the toast messages are the same, the user is not able to distinguish which was previous and wich is next toast. I am firing them with two functions. Any help would be appreciated.
This is my setup:

autoDismiss: true,
        maxOpened: 2,
        newestOnTop: true,
        extendedTimeOut: 1000,
        tapToDismiss: false,
        timeOut: 5000
ilmyapht

ilmyapht1#

Immediately remove current toasts without using animation

toastr.remove()

Remove current toasts using animation

toastr.clear()

Every thing is mention on github

mwkjh3gx

mwkjh3gx2#

Set

maxOpened: 1

in toastrConfig. This will prevent toasts from stacking and the second one will show up as soon as the first one expires.

b1payxdu

b1payxdu3#

在你的祝酒词之前用这个。

toastr.clear()

第一次

相关问题