mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
Added a toast service error to show error messages on the screen isntead of using console.log
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ToastController } from '@ionic/angular';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ToastService {
|
||||
|
||||
constructor(public toastController: ToastController) { }
|
||||
|
||||
async presentToast(infoMessage: string) {
|
||||
const toast = await this.toastController.create({
|
||||
message: infoMessage,
|
||||
duration: 2000
|
||||
});
|
||||
toast.present();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user