You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method exposed by NbToastrService could work in a similar fashion. Alternatively, it would be easier to make show() return the toast object, and then we could use that to close it, like so:
Issue type
I'm submitting a ...
Issue description
Current behavior:
Toastr can't be closed programmatically via a method like
hide()
/close()
.If we set
duration
to0
anddestroyByClick
tofalse
, there is no easy way to get rid of the toastr.Expected behavior:
It would be handy to destroy the toastr via a method exposed by
NbToastrService
. In this way we could do something like:Related code:
My current workaround is the following.
In the component where I show the toastr that I want to delete programmatically, I set this in the constructor:
Then, to delete the toastr, I do the following
The method exposed by NbToastrService could work in a similar fashion. Alternatively, it would be easier to make
show()
return thetoast
object, and then we could use that to close it, like so:PS In my workaround I use
container['toasts']
instead ofcontainer.toasts
to avoid error messages ontoasts
being a protected property.The text was updated successfully, but these errors were encountered: