I am using a <page-router-outlet></page-router-outlet> and <BottomNavigation></BottomNavigation> setup for tabs in my Nativescript Angular project, and am having trouble navigating from 1 child tab route to another child tab route.
So here is the app-routing.module.ts:
const routes: Routes = [
{ path: '', redirectTo: '/auth', pathMatch: 'full' },
{ path: 'auth', component: AuthComponent },
{ path: 'individual-tasks', component: SpecificTasksComponent },
{
path: 'tabs',
component: TabsComponent,
children: [
{
path: 'feed',
loadChildren: '~/app/pages/feed/feed.module#FeedModule',
component: NSEmptyOutletComponent,
outlet: 'feedTab'
},
{
path: 'notification',
loadChildren: '~/app/pages/notification/notification.module#NotificationModule',
component: NSEmptyOutletComponent,
outlet: 'notificationTab'
},
{
path: 'create',
loadChildren: '~/app/pages/create/create.module#CreateModule',
component: NSEmptyOutletComponent,
outlet: 'createTab'
},
{
path: 'profile',
loadChildren: '~/app/pages/profile/profile.module#ProfileModule',
component: NSEmptyOutletComponent,
outlet: 'profileTab'
}
]
}
];
And I am currently trying to navigate from within the create tab module to the feed tab module. Here is the create-routing.module.ts:
const routes: Routes = [
{ path: '', redirectTo: 'create', pathMatch: 'full' },
{ path: 'create', component: CreateComponent },
{ path: 'create-tasks', component: CreateTasksComponent },
{ path: 'create-preview', component: CreatePreviewComponent }
];
So if I am currently within the create-preview route how can I navigate back to the "tabs/feed" outlet thats in the app-routing.module.ts?
I have been trying this:
this.router.navigate([
'../tabs', {
outlets: { feedTab: ['feed'] }, relativeTo: this.activatedRoute
}
]);
but even though I am explicitly writing that the navigation should be to the feedTab, it still navigates to the starting outlet (profile) instead of the feed outlet. It is like the outlet stated is entirely ignored... Any ideas???