Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@elmarputz
Created March 18, 2019 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elmarputz/fa882a84cb1b87fc1c8aeb4b76f9597e to your computer and use it in GitHub Desktop.
Save elmarputz/fa882a84cb1b87fc1c8aeb4b76f9597e to your computer and use it in GitHub Desktop.
app-routing.module.ts
import { NgModule } from '@angular/core';
import {Routes, RouterModule} from '@angular/router';
import { BookDetailsComponent } from './book-details/book-details.component';
import { BookListComponent } from './book-list/book-list.component';
import { HomeComponent } from './home/home.component';
const routes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'home', component: HomeComponent },
{ path: 'books', component: BookListComponent },
{ path: 'books/:isbn', component: BookDetailsComponent }
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule],
providers: []
})
export class AppRoutingModule { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment