X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fapp-routing.module.ts;h=04c53548eb375999361ab90a478ed9964450bcaf;hb=61b909b9bf849516f30dab2bf5977acfbbddc5c6;hp=900a4c5b6d064b4cc048f65c73b8f297d117697e;hpb=693b1aba4675f7e3d850e0f6d07dbfc7bdff9b8c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/app-routing.module.ts b/client/src/app/app-routing.module.ts index 900a4c5b6..04c53548e 100644 --- a/client/src/app/app-routing.module.ts +++ b/client/src/app/app-routing.module.ts @@ -1,17 +1,41 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { NgModule } from '@angular/core' +import { RouterModule, Routes } from '@angular/router' + +import { PreloadSelectedModulesList } from './core' const routes: Routes = [ { - path: '', - redirectTo: '/videos/list', - pathMatch: 'full' + path: 'admin', + loadChildren: './+admin/admin.module#AdminModule' + }, + { + path: 'my-account', + loadChildren: './+my-account/my-account.module#MyAccountModule' + }, + { + path: 'accounts', + loadChildren: './+accounts/accounts.module#AccountsModule' + }, + { + path: 'video-channels', + loadChildren: './+video-channels/video-channels.module#VideoChannelsModule' + }, + { + path: '**', + loadChildren: './+page-not-found/page-not-found.module#PageNotFoundModule' } -]; +] @NgModule({ - imports: [ RouterModule.forRoot(routes) ], + imports: [ + RouterModule.forRoot(routes, { + useHash: Boolean(history.pushState) === false, + preloadingStrategy: PreloadSelectedModulesList + }) + ], + providers: [ + PreloadSelectedModulesList + ], exports: [ RouterModule ] }) export class AppRoutingModule {} -