Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to redirect to a page with ionic 2 without push/popping

I am building an application with Ionic 2. Once successfully logged in, the home page is pushed on top of the login page. The only problem with this is that the "back" icon appears at the top of the home page. I want a way of redirecting to the home page upon login such that the "back" icon does not appear.

Thanks

like image 365
Dansmith12 Avatar asked Dec 15 '22 00:12

Dansmith12


1 Answers

You have to setRoot. That way the new component is the root, which in your case would be the HomePage component.

this.navCtrl.setRoot(HomePageComponent, {}, {animate: true, direction: 'forward'});
like image 91
JorgeObregon Avatar answered Dec 28 '22 07:12

JorgeObregon