How to close a page opened over tabs


#1

I opened a page over tabs like

this.app.getRootNav().setRoot(pageName)

Now i want to know how to close this page and the comes to same old originated page

Also i want to know how to close this page on android device back button??
Thanks in advance


#2

Hi,
for opening next page do not use setRoot() but navPush(yourPage). Then you can go back by navPop() function.

To close (go back) on tap android device back button use function from docs


#3

Hi mcihak

Thanks for your reply
Hope navPush opens a page over tabs??

Because I want to use that page for deeplink??

Also i have to open this page onclick of list

Can you pls send the small snippet to open this on click of list

Regards
Vinay


#4

Yes, it will open over tabs. I am using this code:

(click)="navTo(yourPage)"

navTo(page){
    this.navCtrl.parent.parent.push(page)
}


#5

Thanks for that,

can i know how to close this from the page opened??

this.navCtrl.parent.parent.pop(); did not work

Thanks in advance


#6

Just use this.navCtrl.pop()


#7

Awesome Mcihak. Thanks a lot…


#8

How do i close this on device back button?


#9

I told you already. You have to use function from documentation: https://ionicframework.com/docs/api/platform/Platform/#registerBackButtonAction