You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

31 rivejä
1.3 KiB

  1. import { NgModule } from '@angular/core';
  2. import { Routes, RouterModule } from '@angular/router'
  3. import { RecipesComponent } from './recipes/recipes.component';
  4. import { ShoppingListComponent } from './shopping-list/shopping-list.component';
  5. import { RecipeDetailComponent } from './recipes/recipe-detail/recipe-detail.component';
  6. import { RecipeStartComponent } from './recipes/recipe-start/recipe-start.component';
  7. import { RecipeEditComponent } from './recipes/recipe-edit/recipe-edit.component';
  8. import { SignupComponent } from './auth/signup/signup.component';
  9. import { SigninComponent } from './auth/signin/signin.component';
  10. const appRoutes: Routes = [
  11. { path: '', redirectTo: '/recipes', pathMatch: 'full' },
  12. { path: 'recipes' , component: RecipesComponent, children: [
  13. { path: '', component: RecipeStartComponent },
  14. { path: 'new', component: RecipeEditComponent },
  15. { path: ':id', component: RecipeDetailComponent },
  16. { path: ':id/edit', component: RecipeEditComponent}
  17. ] },
  18. { path: 'shopping-list', component: ShoppingListComponent },
  19. { path: 'signup', component: SignupComponent },
  20. { path: 'signin', component: SigninComponent }
  21. ];
  22. @NgModule({
  23. imports: [RouterModule.forRoot(appRoutes)],
  24. exports: [RouterModule]
  25. })
  26. export class AppRoutingModule {
  27. }