How should you Handle Tab Based Applications in Ionic? #127
-
Hello, I'm running into an issue with my Ionic Tab based Application. I'm noticing that if I have 2 tabs both which have a tour in them I can't have them both showing at the same time because the needs to be in the app.component.html. This presents and issue because if a tour is started in Tab 1 and then a user navigates to Tab 2 the tour will show over all other elements regardless of the tab. This also presents issues when navigating backwards and forwards if the Tour is started at the same moment a user clicks to navigate e Is there a way to specify a specific for each tab and provide an ID of some sort? Something along the lines of
Then when initializing the tour I could specify which template I want it to use. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
<tour-step-template>
<ng-template let-step="step">
<ng-container *ngIf="activeTab === 'tab1'; else tab2Template">
<app-tab1-template [step]="step" />
</ng-container>
<ng-template #tab2Template>
<app-tab2-template [step]="step" />
</ng-template>
</ng-template>
</tour-step-template>
|
Beta Was this translation helpful? Give feedback.
-
@hakimio Thank you. I will give this a try. |
Beta Was this translation helpful? Give feedback.
TourService
is global to the whole app. Normally if the user (not the UI tour itself) navigates to a different page (app route changes), the tour ends automatically.*ngIf
to switch between the templates: