2017-06-16 07:32:15 -05:00
|
|
|
import { NgModule } from '@angular/core'
|
2019-03-21 10:49:46 -05:00
|
|
|
import { RouteReuseStrategy, RouterModule, Routes } from '@angular/router'
|
2017-10-09 07:28:44 -05:00
|
|
|
|
|
|
|
import { PreloadSelectedModulesList } from './core'
|
2018-06-28 10:16:22 -05:00
|
|
|
import { AppComponent } from '@app/app.component'
|
2019-03-21 10:49:46 -05:00
|
|
|
import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy'
|
2020-03-07 06:50:26 -06:00
|
|
|
import { MenuGuards } from '@app/core/routing/menu-guard.service'
|
2016-11-20 10:18:15 -06:00
|
|
|
|
|
|
|
const routes: Routes = [
|
2018-05-17 08:25:50 -05:00
|
|
|
{
|
|
|
|
path: 'admin',
|
2020-03-07 06:50:26 -06:00
|
|
|
canActivate: [ MenuGuards.close() ],
|
|
|
|
canDeactivate: [ MenuGuards.open() ],
|
2019-07-24 09:05:59 -05:00
|
|
|
loadChildren: () => import('./+admin/admin.module').then(m => m.AdminModule)
|
2018-05-17 08:25:50 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'my-account',
|
2019-07-24 09:05:59 -05:00
|
|
|
loadChildren: () => import('./+my-account/my-account.module').then(m => m.MyAccountModule)
|
2018-05-17 08:25:50 -05:00
|
|
|
},
|
2018-08-31 02:18:19 -05:00
|
|
|
{
|
|
|
|
path: 'verify-account',
|
2019-07-24 09:05:59 -05:00
|
|
|
loadChildren: () => import('./+signup/+verify-account/verify-account.module').then(m => m.VerifyAccountModule)
|
2018-08-31 02:18:19 -05:00
|
|
|
},
|
2018-05-17 08:25:50 -05:00
|
|
|
{
|
|
|
|
path: 'accounts',
|
2019-07-24 09:05:59 -05:00
|
|
|
loadChildren: () => import('./+accounts/accounts.module').then(m => m.AccountsModule)
|
2018-05-17 08:25:50 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'video-channels',
|
2019-07-24 09:05:59 -05:00
|
|
|
loadChildren: () => import('./+video-channels/video-channels.module').then(m => m.VideoChannelsModule)
|
2018-05-31 04:35:01 -05:00
|
|
|
},
|
2018-06-27 07:21:03 -05:00
|
|
|
{
|
|
|
|
path: 'about',
|
2019-07-24 09:05:59 -05:00
|
|
|
loadChildren: () => import('./+about/about.module').then(m => m.AboutModule)
|
2018-06-27 07:21:03 -05:00
|
|
|
},
|
2019-05-29 07:39:49 -05:00
|
|
|
{
|
|
|
|
path: 'signup',
|
2019-07-24 09:05:59 -05:00
|
|
|
loadChildren: () => import('./+signup/+register/register.module').then(m => m.RegisterModule)
|
2019-05-29 07:39:49 -05:00
|
|
|
},
|
2018-06-28 10:16:22 -05:00
|
|
|
{
|
|
|
|
path: '',
|
|
|
|
component: AppComponent // Avoid 404, app component will redirect dynamically
|
|
|
|
},
|
2018-05-31 04:35:01 -05:00
|
|
|
{
|
|
|
|
path: '**',
|
2019-07-24 09:05:59 -05:00
|
|
|
loadChildren: () => import('./+page-not-found/page-not-found.module').then(m => m.PageNotFoundModule)
|
2018-05-17 08:25:50 -05:00
|
|
|
}
|
2017-06-16 07:32:15 -05:00
|
|
|
]
|
2016-11-20 10:18:15 -06:00
|
|
|
|
|
|
|
@NgModule({
|
2017-09-06 14:48:15 -05:00
|
|
|
imports: [
|
|
|
|
RouterModule.forRoot(routes, {
|
|
|
|
useHash: Boolean(history.pushState) === false,
|
2019-03-21 10:49:46 -05:00
|
|
|
scrollPositionRestoration: 'disabled',
|
2019-01-08 08:06:58 -06:00
|
|
|
preloadingStrategy: PreloadSelectedModulesList,
|
2019-03-21 10:49:46 -05:00
|
|
|
anchorScrolling: 'disabled'
|
2017-09-06 14:48:15 -05:00
|
|
|
})
|
|
|
|
],
|
2018-03-01 06:57:29 -06:00
|
|
|
providers: [
|
2020-03-07 06:50:26 -06:00
|
|
|
MenuGuards.guards,
|
2019-03-21 10:49:46 -05:00
|
|
|
PreloadSelectedModulesList,
|
|
|
|
{ provide: RouteReuseStrategy, useClass: CustomReuseStrategy }
|
2018-03-01 06:57:29 -06:00
|
|
|
],
|
2016-11-20 10:18:15 -06:00
|
|
|
exports: [ RouterModule ]
|
|
|
|
})
|
|
|
|
export class AppRoutingModule {}
|