I am using angular2 full version and i am trying to implement lazy loading. my main routing is as below
export const ROUTES: Routes = [
{ path: 'login', component: LoginPage },
{ path: 'reset-password', component: Myaccount },
{
path: '',
redirectTo: 'app',
pathMatch: 'full'
},
...ROUTES_APP,
{ path: "sub", loadChildren: "es6-promise?,[name]!./app/sub/sub.module#SubModule" },
];
My Sub routing is as below
import { Routes, RouterModule } from "@angular/router";
import { SubAppComponent } from "./sub-app.component";
import { SubHomeComponent } from "./sub-home.component";
export const subRoutes: Routes = [
{
path: "",
component: SubAppComponent,
children: [
{ path: "", component: SubHomeComponent }
]
},
];
export const subRouting = RouterModule.forChild(subRoutes);
My sub module is as below
import { NgModule } from "@angular/core";
import { subRouting } from "./sub.routing";
import { SubAppComponent } from "./sub-app.component";
import { SubHomeComponent } from "./sub-home.component";
@NgModule({
imports: [
subRouting,
],
declarations: [
SubAppComponent,
SubHomeComponent,
],
})
export class SubModule {
}
while navigating to sub i am getting error But i am getting below error
core.umd.js:3462 EXCEPTION: Uncaught (in promise): TypeError: System.import is not a function
Please help me on this/ let me know how to handle lazy loading using webpack
System.js. Angular2 webpack version doesn't use system.js at all.