Skip to content

Instantly share code, notes, and snippets.

@davidgjordan
Last active August 25, 2017 00:22
Show Gist options
  • Save davidgjordan/cd51a753b2b14d5639acdfe0a432267c to your computer and use it in GitHub Desktop.
Save davidgjordan/cd51a753b2b14d5639acdfe0a432267c to your computer and use it in GitHub Desktop.
Routing Angular 4
import { ModuleWithProviders } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
//importamos los componentes
import { AboutComponent, PortafolioComponent, PortafolioItemComponent } from './components/index.paginas';
//arrray con la configuracion de rutas
const APP_ROUTES:Routes =[
{ path: '', component:PortafolioComponent },
{ path: 'home', component:PortafolioComponent },
{ path: 'about', component:AboutComponent },
{ path: 'portafolio-item', component:PortafolioItemComponent },
{ path: '**', redirectTo:'', pathMatch:'full' }
];
export const ROUTING :ModuleWithProviders = RouterModule.forRoot(APP_ROUTES, { useHash:true });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment