Created
October 24, 2017 17:34
-
-
Save stewones/18f4c7bd46f9609f02d6cdfaec8340ff to your computer and use it in GitHub Desktop.
aula-8 sda 17
This file contains hidden or 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 { RouterModule, Routes } from '@angular/router'; | |
import { HomePageComponent } from "app/pages/home-page/home-page.component"; | |
import { ProductsPageComponent } from "app/pages/products-page/products-page.component"; | |
import { ProductPageComponent } from "app/pages/product-page/product-page.component"; | |
import { Error404PageComponent } from "app/pages/error-404-page/error-404-page.component"; | |
const routes: Routes = [ | |
// home | |
{ | |
path: '', | |
component: HomePageComponent | |
}, | |
// products | |
{ | |
path: 'products', | |
component: ProductsPageComponent | |
}, | |
{ | |
path: 'products/:slug/:id', | |
component: ProductPageComponent | |
}, | |
// handling 404 | |
{ | |
path: '**', component: Error404PageComponent | |
} | |
]; | |
export const RoutingModule = RouterModule.forRoot(routes); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment