Last active
November 16, 2019 13:48
-
-
Save dileno/84e7edb9fbdb6a54e6e783530815e65f to your computer and use it in GitHub Desktop.
App routing module
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 { BlogPostsComponent } from './blog-posts/blog-posts.component'; | |
import { BlogPostComponent } from './blog-post/blog-post.component'; | |
import { BlogPostAddEditComponent } from './blog-post-add-edit/blog-post-add-edit.component'; | |
const routes: Routes = [ | |
{ path: '', component: BlogPostsComponent, pathMatch: 'full' }, | |
{ path: 'blogpost/:id', component: BlogPostComponent }, | |
{ path: 'add', component: BlogPostAddEditComponent }, | |
{ path: 'blogpost/edit/:id', component: BlogPostAddEditComponent }, | |
{ path: '**', redirectTo: '/' } | |
]; | |
@NgModule({ | |
imports: [RouterModule.forRoot(routes)], | |
exports: [RouterModule] | |
}) | |
export class AppRoutingModule { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment