How to remove previous 2 pages history in Ionic

Hi, I need below functionality. How can I achieve this? Can anyone help me out?..

Page 1 will be the root page. After going to Page2, I will go to Page3(Login Page in my case). After Page 3, I will again go to Page2. But while coming back from Page 2, I should directly come back to Page1(RootPage) by skipping Page3(LoginPage)

Hey there :slight_smile:
In case your Page1 is also Root page, you can always do navCtrl.popToRoot(); to go directly at first page in navigation stack.

You can also manually specify where you want to get back by navCtrl.popTo(page|viewController), where you specify page viewController you want to return back. You can also do this by manipulating pageIndex: