Skip to content

Instantly share code, notes, and snippets.

@Sampath-Lokuge
Created February 25, 2019 18:55
Show Gist options
  • Save Sampath-Lokuge/274cade424998f245245696839c04087 to your computer and use it in GitHub Desktop.
Save Sampath-Lokuge/274cade424998f245245696839c04087 to your computer and use it in GitHub Desktop.
Show Toast
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