Skip to content

Instantly share code, notes, and snippets.

@nanotroy
Created August 29, 2019 19:38
Show Gist options
  • Save nanotroy/fed70c597ca33d990b9b6c0dadbe42fe to your computer and use it in GitHub Desktop.
Save nanotroy/fed70c597ca33d990b9b6c0dadbe42fe to your computer and use it in GitHub Desktop.
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { FirstComponent } from './first/first.component';
import { SecondComponent } from './second/second.component';
@NgModule({
imports: [
RouterModule.forRoot([
{ path: '', redirectTo: '/firstComponent', pathMatch: 'full' },
{ path: 'firstComponent', component: FirstComponent },
{ path: 'secondComponent', component: SecondComponent }
])
],
exports: [ RouterModule ]
})
export class AppRoutingModule {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment