Skip to content

Instantly share code, notes, and snippets.

@stewones
Created October 24, 2017 17:34
Show Gist options
  • Save stewones/18f4c7bd46f9609f02d6cdfaec8340ff to your computer and use it in GitHub Desktop.
Save stewones/18f4c7bd46f9609f02d6cdfaec8340ff to your computer and use it in GitHub Desktop.
aula-8 sda 17
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