How to link another page while press the BACK button


#1

Hi,
I am new to Ionic.
I created an menu-item which is linked to a inapp-browser native plugin and open a website.
I put the code inside my-facebook.ts file:

ngOnInit() {
   const browser = this.iab.create("https://www.facebook.com/myfacebook/", "yes", "location=no");
   browser.show();
 };

So it will show the website in an inapp-browser.
Because basically, my-facebook.html is empty, so if I click the BACK button, it will show this empty html page, it’s not what I want.
I need a way while I click the BACK button, it will go back to another page, like homepage.

Please help, and thank you.


#2

Don’t do it that way but trigger a function from the menu directly that opens the IAB.


#3

I am a newbie, would you please show me how to do that.
Thanks a lot.