Skip to content

Instantly share code, notes, and snippets.

@rahulsahay19
Created November 14, 2017 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahulsahay19/62dd25c149095792f7e5798cdeb5c255 to your computer and use it in GitHub Desktop.
Save rahulsahay19/62dd25c149095792f7e5798cdeb5c255 to your computer and use it in GitHub Desktop.
dynamic-routing.module
import { ModuleWithProviders } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import DynamicComponent from './dynamic.component';
import { MoviesComponent } from './movies/movies.component';
import { SampleComponent } from './sample.component';
const dynamicRoutes: Routes = [
{ path: '', component: DynamicComponent, pathMatch: 'full' },
{ path: 'movies', component: MoviesComponent},
{ path: 'sample', component: SampleComponent}
];
export const routes: ModuleWithProviders = RouterModule.forChild(dynamicRoutes);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment