Skip to content

Instantly share code, notes, and snippets.

@camilogiraldo
Created January 18, 2018 02:18
Show Gist options
  • Save camilogiraldo/a062adc40caf583011f994c066ebcc27 to your computer and use it in GitHub Desktop.
Save camilogiraldo/a062adc40caf583011f994c066ebcc27 to your computer and use it in GitHub Desktop.
App routing
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponentComponent } from './home-component/home-component.component';
import { BigFeatureComponentComponent } from './big-feature-component/big-feature-component.component';
// New code
const routes: Routes = [
{ path: '', pathMatch: 'full', redirectTo: 'home'},
{ path: 'home', component: HomeComponentComponent},
{ path: 'bigComponent', component: BigFeatureComponentComponent}
];
@NgModule({
imports: [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