javascript - Ionic 2 : using Toast inside an alert handler throws an ExpressionChangedAfterItHasBeenCheckedException -


i tried display toast after user pressed button in alert throws expressionchangedafterithasbeencheckedexception in dev mode. believe it's ionic bug. has experienced same issue ? can confirm i'm not doing mistakes ?

here's code :

let prompt = this.alertcontroller.create({     title: 'alert displaying toast',     buttons: [{       text: 'cancel',       role: 'cancel'     }, {       text: 'display toast',       handler: () => {         displaytoast();         }     }] });  prompt.present(); 

and displaytoast() :

displaytoast() {   let toast = this.toastcontroller.create({     message: 'toast displayed inside alert',     duration: 2000   });    toast.present(); } 

to reproduce exception, have display alert multiple times , press 'cancel' or 'display' buttons many times.

cheers


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -