Skip to content

Instantly share code, notes, and snippets.

@KaranPato
Created August 24, 2019 07:32
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 KaranPato/75f0274a57db532b9bcfd5e054146e35 to your computer and use it in GitHub Desktop.
Save KaranPato/75f0274a57db532b9bcfd5e054146e35 to your computer and use it in GitHub Desktop.
AppRoutingModule file.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Routes, RouterModule } from '@angular/router';
import { AddUpdateRecipeComponent } from './components/add-update-recipe/add-update-recipe.component';
import { RecipeListComponent } from './components/recipe-list/recipe-list.component';
const routes: Routes = [
{ path: 'recipe-list', component: RecipeListComponent },
{ path: '', redirectTo: 'recipe-list', pathMatch: 'full' },
{ path: 'add-update-recipe/:id', component: AddUpdateRecipeComponent }
]
@NgModule({
declarations: [],
imports: [
CommonModule,
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