import { NgModule , NgModuleFactoryLoader , SystemJsNgModuleLoader } from '@angular/core' ; import { BrowserModule } from '@angular/platform-browser' ; import { FormsModule } from '@angular/forms' ; import { RouterModule , Routes } from '@angular/router' ; import { AppComponent } from './app.component' ; import { DynamicComponentsService } from './dynamic-components.service' ; export const appRoutes = [ { path : 'c' , loadChildren : 'src/app/lazy-routes/c/c.module#CModule' } ] ; @ NgModule ( { imports : [ BrowserModule , FormsModule , RouterModule . forRoot ( appRoutes ) ] , providers : [ DynamicComponentsService ] , declarations : [ AppComponent ] , bootstrap : [ AppComponent ] } ) export class AppModule { }