Problem loading on clicked page
I have a thread in my application that at some point I push the page onto the stack and on that page I call the load dialog to load some data. The problem is that the download dialog did not appear. Then I realized that when I returned to the previous page, the download was there, under my page that was showing. If in my navigation thread instead nav.push
I use nav.setRoot
it works great, so I think it is a glitch with this navigation glass. I really want to use nav.push
because it makes sense for my application. Any ideas?
EDIT:
my function calling the page:
onViewUnidade(unidade){
if (unidade.tipo == "Unidade Consumidora"){
this.nav.push(UnidadeConsumidoraPage, unidade);
}else if (unidade.tipo == "Usina"){
this.nav.push(UsinaPage, unidade);
}
}
my onInit method:
ngOnInit(){
console.log("show loading");
this.loading = this.loadingCtrl.create({
content: "some message"
});
this.loading.present();
}
My console.log is executing and I didn't even dismiss it, so I could see it correctly. The loadable and loadable controller are imported and inserted correctly.
EDIT 2: I noticed that the problem occurs when the page redirecting to my last page with loading is modal. If I change it for a normal page, it works correctly. Also, try removing the modals and before going to a new page popToRoot
, but you still get the same problem. Any ideas?
source to share
got my answer on the documentation: Instead of injecting the navigation controller when you want to navigate from the overlay component (popover, modal, alert, etc.), We have to get the reference to the root NavController in our application using the getRootNav () method :
this.appCtrl.getRootNav().push(SecondPage);
Hope this helps those who got the same problem!
source to share
Look at UploadOptions
export interface LoadingOptions {
spinner?: string;
content?: string;
cssClass?: string;
showBackdrop?: boolean;
dismissOnPageChange?: boolean;
delay?: number;
duration?: number;
}
You can set dismissOnPageChange
(to true). Make sure you cancel the download dialog or install duration
.
source to share