import { Component , OnInit } from '@angular/core' ; import { NavController , LoadingController , ToastController } from '@ionic/angular' ; @ Component ( { selector : 'app-edit-profile' , templateUrl : './edit-profile.page.html' , styleUrls : [ './edit-profile.page.scss' ] , } ) export class EditProfilePage implements OnInit { constructor ( public navCtrl , public loadingCtrl , public toastCtrl ) { } ngOnInit ( ) { } async sendData ( ) { const loader = await this . loadingCtrl . create ( { duration : 2000 } ) ; loader . present ( ) ; loader . onWillDismiss ( ) . then ( async ( l ) => { const toast = await this . toastCtrl . create ( { showCloseButton : true , cssClass : 'bg-profile' , message : 'Your Data was Edited!' , duration : 3000 , position : 'bottom' } ) ; toast . present ( ) ; this . navCtrl . navigateForward ( '/home-results' ) ; } ) ; } }