Can't open page with loading instance in ngOnInit from modal


#1

Hi. Someone tell me please that this is a bug and I will create an issue or I something missed in my problem.

I am using ionic.2.0.0-beta.9.

1 . I open modal instance

public openModal(): Promise<any> {
        let modal = Modal.create(ShowInfoModal);
        return this.navCtrl.present(modal);
    }

2 . From modal I try to open other page with different methods but got nothing (loading animation from new page appear, than dismiss, but page not changed)

public openBroken1(): Promise<any> {
    return this.navCtrl.setRoot(PaymentMethodPage, {}, {animate: true, direction: 'forward'});
}

 public openBroken2(): Promise<any> {
    return this.viewCtrl.dismiss()
        .then(() => this.navCtrl.setRoot(PaymentMethodPage, {}, {animate: true, direction: 'forward'}));
}

public openBroken3(): Promise<any> {
    this.viewCtrl.destroy();
    return this.navCtrl.setRoot(PaymentMethodPage, {}, {animate: true, direction: 'forward'});
}

public openBroken4(): Promise<any> {
    this.viewCtrl.onDestroy(() => this.navCtrl.setRoot(PaymentMethodPage, {}, {animate: true, direction: 'forward'}));
    return this.viewCtrl.dismiss();
}

3 . In page, that can’t open I implement ngOnInit method with animation (will be used for animate API response loading. In example simplified but still not work)

ngOnInit() {
        var loadingInstance = Loading.create({
            content: 'Loading...'
        });
        this.navCtrl.present(loadingInstance);

        setTimeout(() => {
            loadingInstance.dismiss();
        }, 1000)
    }

Work project with error code placed here.

Or you can clone it with

git clone -b ER-3_navigation_animation_error https://github.com/EugeneSnihovsky/ionic2-for-errors.git

Thanks in advance.


#2

Update to ionic2.beta-10 and has the same problem.


#3

The repo you posted does not have a gulpfile and cannot be built


#4

Probably you cloned master branch from my repository. Current issue located at ER-3_navigation_animation_error branch and contain all files needed for reproduce problem (I just rechecked).