File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { Routes } from '@angular/router' ;
1+ import { NgModule } from '@angular/core' ;
2+ import { RouterModule , Routes } from '@angular/router' ;
23
3- // components
44import { HomeComponent } from './home/home.component' ;
55import { CompareEditorComponent } from './compare-editor/compare-editor.component' ;
66
7- export const appRoutes : Routes = [
7+ const routes : Routes = [
88 { path : '' , component : HomeComponent } ,
99 { path : 'home' , component : HomeComponent } ,
1010 { path : 'textcompare' , component : CompareEditorComponent } ,
1111 // otherwise redirect to home
12- { path : '**' , redirectTo : '' }
12+ { path : '**' , redirectTo : '' } ,
1313] ;
14+
15+ @NgModule ( {
16+ imports : [ RouterModule . forRoot ( routes , { useHash : true } ) ] ,
17+ exports : [ RouterModule ] ,
18+ } )
19+ export class AppRoutingModule { }
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import { FormsModule } from '@angular/forms';
1212import { MonacoEditorModule } from 'ngx-monaco-editor-v2' ;
1313
1414// routes
15- import { appRoutes } from './app.route ' ;
15+ import { AppRoutingModule } from './app-routing.module ' ;
1616
1717@NgModule ( {
1818 declarations : [
@@ -25,8 +25,8 @@ import { appRoutes } from './app.route';
2525 imports : [
2626 BrowserModule ,
2727 FormsModule ,
28- MonacoEditorModule . forRoot ( ) ,
29- RouterModule . forRoot ( appRoutes , { } )
28+ AppRoutingModule ,
29+ MonacoEditorModule . forRoot ( )
3030 ] ,
3131 providers : [ ] ,
3232 bootstrap : [ AppComponent ]
You can’t perform that action at this time.
0 commit comments