app-routing.module.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { NgModule } from '@angular/core';
  2. import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
  3. const routes: Routes = [
  4. {
  5. path: '',
  6. loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
  7. },
  8. {
  9. path: 'user',
  10. loadChildren: () => import('../modules/user/user.module').then(m => m.UserModule)
  11. },
  12. {
  13. path: 'home',
  14. loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)
  15. },
  16. {
  17. path: 'login',
  18. loadChildren: () => import('../modules/user/login/login.module').then(m => m.LoginPageModule)
  19. },
  20. {
  21. path: 'edit-info',
  22. loadChildren: () => import('../modules/user/edit-info/edit-info-routing.module').then(m => m.EditInfoPageRoutingModule)
  23. },
  24. {
  25. path: 'post-detail/:id',
  26. loadChildren: () => import('../modules/post-detail/post-detail.module').then( m => m.PostDetailPageModule)
  27. },
  28. {
  29. path: 'post-create',
  30. loadChildren: () => import('../modules/post-create/post-create.module').then(m => m.PostCreatePageModule)
  31. }
  32. ];
  33. @NgModule({
  34. imports: [
  35. RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
  36. ],
  37. exports: [RouterModule]
  38. })
  39. export class AppRoutingModule {}