Guest User

Untitled

a guest
Sep 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. const routes: Routes = [
  2. {
  3. path: '',
  4. component: InfoPage,
  5. pathMatch: 'full'
  6. },
  7. {
  8. path: 'item',
  9. component: ItemInfoPage
  10. }
  11. ];
  12.  
  13. @NgModule({
  14. imports: [
  15. CommonModule,
  16. FormsModule,
  17. IonicModule,
  18. RouterModule.forChild(routes),
  19. ItemInfoPageModule
  20. ],
  21. declarations: [InfoPage, ]
  22. })
  23. export class InfoPageModule {}
  24.  
  25. const routes: Routes = [
  26. {
  27. path: 'tabs',
  28. component: TabsPage,
  29. children: [
  30. {
  31. path: '',
  32. redirectTo: '/tabs/(home:home)',
  33. pathMatch: 'full',
  34. },
  35. {
  36. path: 'home',
  37. outlet: 'home',
  38. component: HomePage
  39. },
  40. {
  41. path: 'info',
  42. outlet: 'info',
  43. component: InfoPage
  44. },
  45. {
  46. path: 'about',
  47. outlet: 'about',
  48. component: AboutPage
  49. },
  50. {
  51. path: 'contact',
  52. outlet: 'contact',
  53. component: ContactPage
  54. }
  55. ]
  56. },
  57. {
  58. path: '',
  59. redirectTo: '/tabs/(home:home)',
  60. pathMatch: 'full'
  61. }
  62. ];
  63.  
  64. @NgModule({
  65. imports: [RouterModule.forChild(routes)],
  66. exports: [RouterModule]
  67. })
  68. export class TabsPageRoutingModule {}
  69.  
  70. @NgModule({
  71. imports: [
  72. IonicModule,
  73. CommonModule,
  74. FormsModule,
  75. TabsPageRoutingModule,
  76. HomePageModule,
  77. AboutPageModule,
  78. ContactPageModule,
  79. InfoPageModule,
  80. ItemInfoPageModule
  81. ],
  82. declarations: [TabsPage]
  83. })
  84. export class TabsPageModule {}
Add Comment
Please, Sign In to add comment