Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

How to modify toast message in Ionic v3

$
0
0

@davidti wrote:

Hello,

I am trying to modify my toast message, rather than stacking up the toast boxes like so, I wanted to know if there is a possibility to update the message each time I do so. Here is my code.

          import { ToastController, Toast } from 'ionic-angular';
          
          private toastCtrl: ToastController;
          toast: Toast;
          try {
              this.toast.setMessage('Items '+itemCart+' | Rs '+this.total+'');
          } catch(e) {}
      
          this.toast = this.toastCtrl.create({
              message: 'Items '+itemCart+' | Rs '+this.total+'',
              showCloseButton: true,
              closeButtonText:'View Cart',
              position: 'bottom',
              dismissOnPageChange: true
          });
          this.toast.onDidDismiss(() => {
            this.navCtrl.setRoot(CartTabPage);
           });          
          this.toast.present();

Any help will be much appreciated. Thanks in advance

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles