[SOLVED] Loading displayed only after page change

I want to display a loader when the client press a button which should start the navigation.

I do:

this.loading:Loading = this.loadingController.create({
        dismissOnPageChange: true
    });

this.loading.present();

this.navController.push(nextPage, params).then(() => {
    let index = navController.getActive().index;
    this.navController.remove(0, index);
}

I have to notice that the loading popup is only displayed when the next page is displayed and not directly when the present action is called.

Since on my iPhone 4, even with WKWebView, it take some times to execute the push method and display the next page, I would like to display that loading directly on the calling page after the click event is called.

For example not the current behavior sequence “click … 4sec without informations…change page…loading displayed…load stuff 1 sec…loading dismiss” but “click…loading displayed…4 sec…page change…load stuffs 1sec…loading dismissed”

Someone experienced the same behavior and got a solution for it?

Try if updating your code as follows will solve the problem:

this.loading.present().then(() => {
    this.navController.push(nextPage, params).then(() => {
        let index = navController.getActive().index;
        this.navController.remove(0, index);
    }
});

@iignatov AWESOME! Works like a charm. Thx!!!