Wednesday 13 December 2017

Part 16 display toast messages in ionic





in this video, I will show you that how you can display simple toast message in your ionic application.

Toast is a subtle notification that appears on top of an app’s content. Typically, Toasts are displayed for a short duration of time then automatically dismiss.



to create toast message first import this library



import { ToastController } from 'ionic-angular';


then create an instace of this ToastController


export class MyPage {
constructor(public toastCtrl: ToastController) {
}


after it create a method to display a toast message


presentToast() {
let toast = this.toastCtrl.create({
message: 'User was added successfully',
duration: 3000, // 3 secs

position : top// middle
});
toast.present();
}
}



then call this method in button



<button ion-button (click)="presentToast()">click me</button>

====================================================

to download full source code and presentation visit our wesite and Blog



website : - http://dotnetlab.in/

source code : - https://github.com/rahuljograna

facebook page :- https://www.facebook.com/DotnetLab-1896440207343189/

visit my blog : - http://aspnetinhindi.blogspot.in

follow me on twitter : https://twitter.com/THEJOGRANA



1 comment:

Part 20 consuming rest api in ionic

in this video, I will show you that how you can consume the rest API. in the previous video we have implemented the asp.net web API projec...