Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48977

Having two supertabs pages, how to go from first page to second page programmatically?

$
0
0

Hello everyone!

As I see in the documentation, there’s active-tab-index property and so I tried to set in my service a property to set current active tab when I do a click on an item in first tab’s page… so I did:

<super-tabs tabsPlacement="top" [activeTabIndex]=myService.selectedTabIndex>...</super-tabs>

so when I am inside first tab’s page, page1.page.ts and I want to go automatically to second page so I set:

function callSecondPage() {
    this.myService.selectedTabIndex = 1;
}

so in this way in the html of home page it should set automatically the property and go on second page but it doesn’t work.
I tried also to call:

this.router.navigate(['/secondpage']);

with a Router but it shows the second page on entire screen, not the same as changing just tab page… so how I can change tab page programmatically in the correct way?

My Ionic info is:

Ionic:

   Ionic CLI                     : 6.16.3 (C:\Users\npule\AppData\Roaming\npm\node_modules\@ionic\cli)
   Ionic Framework               : @ionic/angular 5.6.12
   @angular-devkit/build-angular : 12.1.4
   @angular-devkit/schematics    : 12.1.4
   @angular/cli                  : 12.1.4
   @ionic/angular-toolkit        : 4.0.0

Capacitor:

   Capacitor CLI      : 3.1.2
   @capacitor/android : 3.1.2
   @capacitor/core    : 3.1.2
   @capacitor/ios     : not installed

Utility:

   cordova-res : not installed globally
   native-run  : 1.4.0

System:

   NodeJS : v14.17.4 (C:\Program Files\nodejs\node.exe)
   npm    : 6.14.14
   OS     : Windows 10

Thanks to all!
Cheers! :slight_smile:

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48977

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>