Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70432

Ionic 5 tabs redirect a tab to specific page

$
0
0

@Pratikjaiswa15 wrote:

I have 5 tabs in my app. From which I want to redirect the 5th tab to a page in the app automatically. i.e. when the user clicks on tab5 he should be redirected to page called carts

I have added carts page in children’s path of the 5th tab and tried to redirect. But nothing is happening. 5th tab is not redirecting to carts page

here is the code

app.routing.module

{
    path: '',
    loadChildren: () => import('./pages/tabbar/tabbar.module').then( m => m.TabbarPageModule)
  },

tabbar.routing.module

{
    path: 'tabs',
    component: TabbarPage,
    children : [
      {
        path: 'tab1',
        loadChildren: () => import('../tab1/tab1.module').then( m => m.Tab1PageModule)
      },
      {
        path: 'tab2',
        loadChildren: () => import('../tab2/tab2.module').then( m => m.Tab2PageModule)
      },

      {
        path: 'tab3',
        loadChildren: () => import('../tab3/tab3.module').then( m => m.Tab3PageModule)
      },

      {
        path: 'tab4',
        loadChildren: () => import('../tab4/tab4.module').then( m => m.Tab4PageModule)
      },

      {
        path: 'tab5',
        loadChildren: () => import('../tab5/tab5.module').then( m => m.Tab5PageModule),
      },

      {
        path: '',
        redirectTo: '/tabs/tab1',
        pathMatch: 'full'
      }
    ]
  },
  {
    path: '',
    redirectTo: '/tabs/tab1',
    pathMatch: 'full'
  }

tab5.routing.module

{
    path: '',
    component : Tab5Page,
    children : [

      {
        path : 'carts',
        loadChildren : () => import('../carts/carts.module').then(m => m.CartsPageModule)
      },

      {
        path : '',
        redirectTo : '/tab5/carts',
        pathMatch : 'full'
      }
    ]
  },

  {
    path : '',
    redirectTo : '/tab5/carts',
    pathMatch : 'full'
  }

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70432

Trending Articles



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