From: Kai Moritz Date: Sun, 3 May 2020 12:12:34 +0000 (+0200) Subject: 5: Add In-app Navigation X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=bf2c0b48e2a1a30943716a66b72ae0f1e9de2d6f;p=examples%2Fangular-tour-of-heroes 5: Add In-app Navigation a) Add the AppRoutingModule --- diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts new file mode 100644 index 0000000..807a865 --- /dev/null +++ b/src/app/app-routing.module.ts @@ -0,0 +1,15 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { HeroesComponent } from './heroes/heroes.component'; + + +const routes : Routes = [ + { path: 'heroes', component: HeroesComponent } +]; + + +@NgModule({ + imports: [ RouterModule.forRoot(routes) ], + exports: [ RouterModule ] +}) +export class AppRoutingModule { } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index c84535d..c66df3c 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,5 +1,6 @@ import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; +import { AppRoutingModule } from './app-routing.module'; import { FormsModule } from '@angular/forms'; import { AppComponent } from './app.component'; @@ -16,6 +17,7 @@ import { MessagesComponent } from './messages/messages.component'; ], imports: [ BrowserModule, + AppRoutingModule, FormsModule ], providers: [],