Created
March 18, 2019 10:19
-
-
Save elmarputz/fa882a84cb1b87fc1c8aeb4b76f9597e to your computer and use it in GitHub Desktop.
app-routing.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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