We are worked on ionic native mobile app.In application have more then 10 page.
Loader code: //LoaderService
this.loader = this.loadingCtrl.create({
content: "Loading",
//duration: 2000,
});
return this.loader;
this.loader = this.LoaderService();
this.loader.present();//Loader start
his.loader.dismiss();//Loader Stop
Loader we are using every page .If loader is open in that time user click back button, Back button function working it's going to other page loader also going to next page .
We need if loader open back button code should stop working
Back button code app.component.ts
if (this.platform.is('android')) {
this.platform.registerBackButtonAction((e) => {
//my code
});
}
We tried one way like put flag true while loader present.while dismiss set flag false.But we can't change every page.Give me any idea for that
location.onPopState(() => { window.history.forward(); });fromimport { PlatformLocation } from '@angular/common';andprivate location: PlatformLocationin the constructor. But mine is a web application not sure if it work for ionic. - Swoox