Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to clear toasts before showing a new toast? #149

Closed
abishekrsrikaanth opened this issue Mar 26, 2014 · 5 comments
Closed

How to clear toasts before showing a new toast? #149

abishekrsrikaanth opened this issue Mar 26, 2014 · 5 comments
Labels

Comments

@abishekrsrikaanth
Copy link

I have the following code that I use to show the errors as a bottom full-width

toastr.options = {
            "closeButton": true,
            "debug": false,
            "positionClass": "toast-bottom-full-width",
            "onclick": null,
            "showDuration": "1000",
            "hideDuration": "0",
            "timeOut": "0",
            "extendedTimeOut": "1000",
            "showEasing": "swing",
            "hideEasing": "linear",
            "showMethod": "fadeIn",
            "hideMethod": "fadeOut"
        };
toastr.error(message, title);

I am trying to clear all the previous toastr message before I call this again. How can I do that?

Calling toastr.clear(), before setting the options, breaks the options.

Example: http://cssdeck.com/labs/wbzeauxe

@jeremyasm
Copy link

image

@SelvakumarMahalingam
Copy link

Thank you jeremyasm

@aamirrajpot
Copy link

image

where to add this code ??
Please explain a little bit

@naveedshahji
Copy link

@aamirrajpot add it in appmodule like imports: [ ToastrModule.forRoot({maxOpened: 1}),]

@DeliaMaciasUrzua
Copy link

image

and next i create a service like this..
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants