app.routes.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import { HttpClientModule } from '@angular/common/http';
  2. import { NgModule } from '@angular/core';
  3. import { PreloadAllModules, RouteReuseStrategy, RouterModule, Routes } from '@angular/router';
  4. import { IonicRouteStrategy } from '@ionic/angular';
  5. export const routes: Routes = [
  6. {
  7. path: '',
  8. loadChildren: () => import('./tabs/tabs.routes').then((m) => m.routes),
  9. },
  10. {
  11. path: 'story-generator',
  12. loadComponent: () => import('./story-generator/story-generator.page').then(m => m.StoryGeneratorPage)
  13. },
  14. {
  15. path: 'toolbox',
  16. loadComponent: () => import('./toolbox/toolbox.page').then(m => m.ToolboxPage)
  17. },
  18. {
  19. path: '',
  20. loadChildren: () => import('./tabs/tabs.routes').then((m) => m.routes),
  21. },
  22. {
  23. path: 'register',
  24. loadComponent: () => import('./register/register.page').then(m => m.RegisterPage)
  25. },
  26. {
  27. path: 'login',
  28. loadComponent: () => import('./login/login.page').then(m => m.LoginPage)
  29. },
  30. {
  31. path: 'short-generator',
  32. loadComponent: () => import('./short-generator/short-generator.page').then(m => m.ShortGeneratorPage)
  33. },
  34. {
  35. path: 'character',
  36. loadComponent: () => import('./character/character.page').then(m => m.CharacterPage)
  37. },
  38. {
  39. path: 'character-creator',
  40. loadComponent: () => import('./character-creator/character-creator.page').then(m => m.CharacterCreatorPage)
  41. },
  42. {
  43. path: 'chapter-generator',
  44. loadComponent: () => import('./chapter-generator/chapter-generator.page').then( m => m.ChapterGeneratorPage)
  45. },
  46. {
  47. path: 'character-detail/:id',
  48. loadComponent: () => import('./character-detail/character-detail.component').then(m => m.CharacterDetailComponent)
  49. }
  50. ];
  51. @NgModule({
  52. imports: [RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }), HttpClientModule],
  53. exports: [RouterModule],
  54. providers: [
  55. { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
  56. ],
  57. })
  58. export class AppRoutingModule { }