Skip to content

Commit

Permalink
Use hash based routing for GitHub pages
Browse files Browse the repository at this point in the history
  • Loading branch information
fboeller committed Mar 7, 2021
1 parent 6e926a6 commit 9a47dda
Showing 1 changed file with 55 additions and 52 deletions.
107 changes: 55 additions & 52 deletions projects/example-app/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,58 +9,61 @@ import { SidebarComponent } from './sidebar/sidebar.component';
declarations: [AppComponent, SidebarComponent],
imports: [
BrowserModule,
RouterModule.forRoot([
{
path: 'examples',
children: [
{
path: 'custom-default-loading',
loadChildren: () =>
import(
'./examples/custom-default-loading-example/custom-default-loading-example.module'
).then((m) => m.CustomDefaultLoadingExampleModule),
},
{
path: 'ngrx',
loadChildren: () =>
import('./examples/ngrx-example/ngrx-example.module').then(
(m) => m.NgrxExampleModule
),
},
{
path: 'custom-loading-template',
loadChildren: () =>
import(
'./examples/custom-loading-template-example/custom-loading-template-example.module'
).then((m) => m.CustomLoadingTemplateExampleModule),
},
{
path: 'default',
loadChildren: () =>
import('./examples/default-example/default-example.module').then(
(m) => m.DefaultExampleModule
),
},
{
path: 'lightweight',
loadChildren: () =>
import(
'./examples/lightweight-example/lightweight-example.module'
).then((m) => m.LightweightExampleModule),
},
{
path: '',
pathMatch: 'full',
redirectTo: 'default',
},
],
},
{
path: '',
pathMatch: 'full',
redirectTo: 'examples',
},
]),
RouterModule.forRoot(
[
{
path: 'examples',
children: [
{
path: 'custom-default-loading',
loadChildren: () =>
import(
'./examples/custom-default-loading-example/custom-default-loading-example.module'
).then((m) => m.CustomDefaultLoadingExampleModule),
},
{
path: 'ngrx',
loadChildren: () =>
import('./examples/ngrx-example/ngrx-example.module').then(
(m) => m.NgrxExampleModule
),
},
{
path: 'custom-loading-template',
loadChildren: () =>
import(
'./examples/custom-loading-template-example/custom-loading-template-example.module'
).then((m) => m.CustomLoadingTemplateExampleModule),
},
{
path: 'default',
loadChildren: () =>
import(
'./examples/default-example/default-example.module'
).then((m) => m.DefaultExampleModule),
},
{
path: 'lightweight',
loadChildren: () =>
import(
'./examples/lightweight-example/lightweight-example.module'
).then((m) => m.LightweightExampleModule),
},
{
path: '',
pathMatch: 'full',
redirectTo: 'default',
},
],
},
{
path: '',
pathMatch: 'full',
redirectTo: 'examples',
},
],
{ useHash: true }
),
],
bootstrap: [AppComponent],
})
Expand Down

0 comments on commit 9a47dda

Please sign in to comment.