Skip to content

Commit 814848b

Browse files
committed
use hash for route path
1 parent 8290411 commit 814848b

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

src/app/app.module.ts

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { BrowserModule } from '@angular/platform-browser';
21
import { NgModule } from '@angular/core';
32
import { FormsModule } from '@angular/forms';
3+
import { BrowserModule } from '@angular/platform-browser';
44
import { RouterModule } from '@angular/router';
55

66
import { AppComponent } from './app.component';
7-
import { MazeComponent } from './maze/maze.component';
87
import { CandyComponent } from './candy/candy.component';
98
import { CanvasComponent } from './candy/canvas/canvas.component';
10-
import { Math1Component } from './math1/math1.component';
11-
import { EightPuzzleComponent } from './eight-puzzle/eight-puzzle.component';
129
import { EightPuzzleTileComponent } from './eight-puzzle/eight-puzzle-tile/eight-puzzle-tile.component';
13-
import { Math2Component } from './math2/math2.component';
10+
import { EightPuzzleComponent } from './eight-puzzle/eight-puzzle.component';
1411
import { MathModule } from './math/math.module';
12+
import { Math1Component } from './math1/math1.component';
13+
import { Math2Component } from './math2/math2.component';
1514
import { Math3Component } from './math3/math3.component';
15+
import { MazeComponent } from './maze/maze.component';
1616

1717
@NgModule({
1818
declarations: [
@@ -30,16 +30,19 @@ import { Math3Component } from './math3/math3.component';
3030
BrowserModule,
3131
FormsModule,
3232
MathModule,
33-
RouterModule.forRoot([
34-
{ path: '', redirectTo: 'maze', pathMatch: 'full' },
35-
{ path: 'maze', component: MazeComponent },
36-
{ path: 'candy', component: CandyComponent },
37-
{ path: 'math1', component: Math1Component },
38-
{ path: 'math2', component: Math2Component },
39-
{ path: 'math3', component: Math3Component },
40-
{ path: '8-puzzle', component: EightPuzzleComponent },
41-
{ path: '**', redirectTo: '' },
42-
]),
33+
RouterModule.forRoot(
34+
[
35+
{ path: '', redirectTo: 'maze', pathMatch: 'full' },
36+
{ path: 'maze', component: MazeComponent },
37+
{ path: 'candy', component: CandyComponent },
38+
{ path: 'math1', component: Math1Component },
39+
{ path: 'math2', component: Math2Component },
40+
{ path: 'math3', component: Math3Component },
41+
{ path: '8-puzzle', component: EightPuzzleComponent },
42+
{ path: '**', redirectTo: '' },
43+
],
44+
{ useHash: true }
45+
),
4346
],
4447
bootstrap: [AppComponent],
4548
})

0 commit comments

Comments
 (0)