[ionic4-beta17]pop all pages except Root

#1

how to pop all pages except Root in ionic 4 ?

#2

try this!

this.navCtrl.popToRoot()
#3

not exist popToRoot() in NavController in ionic 4 beta 17

#4


Hnm, weird, in this Docs have a popToRoot, sorry for that!

#5

Please refer to the error message in console :

Property ‘popToRoot’ does not exist on type ‘NavController’

#6

hello,

maybe there is something different wrong, because documentations says it exists.
Best regards, anna-liebt

#7

Can you post your code? Probably your import have a error…

#8

sorry for my late reply,
component class code in following :

import { NavController } from '@ionic/angular';
 ...
constructor(private navCtrl: NavController){
 ...
    private goToHome(){
        this.navCtrl.popToRoot().then(() => {
           ....
         });
    }

use <ion-router-outlet main></ion-router-outlet> in app.component.html

#9

not any solution for this problem ?

#10

hello,
yes and sorry NavController has no popToRoot in v4.
Maybe you can implement ion-nav which doc says that it has popToRoot.

Best regards,

anna-liebt

#11

Can someone publish a solution for this?