Skip to content

Instantly share code, notes, and snippets.

@saimon24
Created January 24, 2019 04:10
Show Gist options
  • Save saimon24/ac188dcea23881f047838b7693392c24 to your computer and use it in GitHub Desktop.
Save saimon24/ac188dcea23881f047838b7693392c24 to your computer and use it in GitHub Desktop.
App Routing
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
const routes: Routes = [
{ path: '', redirectTo: 'movies', pathMatch: 'full' },
{ path: 'movies', loadChildren: './pages/movies/movies.module#MoviesPageModule' },
{ path: 'movies/:id', loadChildren: './pages/movie-details/movie-details.module#MovieDetailsPageModule' }
];
@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