angularjs - Angular - ngToast clear all previous toasts and show only one -


i using angular ngtoast. trying show 1 toast @ time. displayed toast should hidden before displaying new toast.there should 1 toast @ time. tried specifying maxnumber doesn't work.

ngtoast.create({         classname: 'info',         content: ' new toast',         maxnumber: 1         //autodismiss: true,         //maxopened: 1         //timeout: 500,         //preventduplicates: true,         //preventopenduplicates: true         //dismissonclick:true         //clicktoclose: true     }); 

here fiddle might you: https://jsfiddle.net/774a9dq4/5/

the difference here before calling new instance of toast object, call dismiss() dismissing toast instances in dom.

ngtoast.dismiss(); ngtoast.create({        content:'i unique <3'  }); 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -