Created
February 25, 2019 18:55
-
-
Save Sampath-Lokuge/274cade424998f245245696839c04087 to your computer and use it in GitHub Desktop.
Show Toast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { ToastController } from '@ionic/angular'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class ShowToastService { | |
constructor(private toastCtrl: ToastController) { } | |
async showErrorToast(data: string) { | |
const toast = await this.toastCtrl.create({ | |
message: data, | |
duration: 3000, | |
position: 'bottom' | |
}); | |
toast.present(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment