Skip to content

Instantly share code, notes, and snippets.

@shadow1349
Created June 2, 2021 18:41
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 shadow1349/424f997a6ff5173383152aec204ec4f8 to your computer and use it in GitHub Desktop.
Save shadow1349/424f997a6ff5173383152aec204ec4f8 to your computer and use it in GitHub Desktop.
sub-route for app-routing module
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { LandingRouteComponent } from './landing-route.component';
/**
* Since this route is lazy loaded in the app-routing.module.ts we will declare a blank
* path here and give it the component we wish to load at the current route.
*/
const routes: Routes = [{ path: '', component: LandingRouteComponent, children: [
{ path: 'variation1', loadChildren: () => import('./variation-1/variation-1.module.ts').then((mod) => mod.Variation1Module) }
] }];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class LandingRouteRoutingModule {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment