Import BusyModule in my module,all routers loadChildren can not use
it is AppModule
@NgModule({
declarations: [
AppComponent,
LoginComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
CommonModule,
BrowserAnimationsModule,
BusyModule,
RouterModule,
RouterModule.forRoot(indexRoutes)
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
it is Router
export const indexRoutes: Routes = [
{
path: '',
redirectTo: '/login.html',
pathMatch: 'full'
},
{
path: 'login.html',
component: LoginComponent
},
{
path: 'test',
loadChildren: './test/index.module#IndexModule'
}
];
it is my project

when use ng serve --prod start

i find all loadChildren can not use,
How to solve?
my angular version is 4.1.3
We must not provide Compiler as JitCompiler. Instead we must provide and inject the Compiler2 extends Compiler. Provide: Compiler2, usefactory: ...
yes @apoterenko that was the solution, I created a new CustomCompiler extends Compiler, and I replaced it in the busy component and the aot compilation works
I will try to create a MR tomorrow.
I did the commit in here https://github.com/Tixifni/angular2-busy/commit/6bdb3343399dc96fc3dbf14cc8bdf6040a7d887a
Also I created https://www.npmjs.com/package/tixif-ngx-busy for testing
Regards.
@Xepe, can you please explain why do you need to Compiler to make JIT compiler work in AOT?
@ipassynk I am not totally sure, the issue that I found is because the JIT Compiler is set for the Compiler and for JIT is ok but for AOT it does not work, I got some error like "the compiler is not loaded", for that reason I created a extends of Compiler and I setup that customCompiler where the component need it.
I am having the same issue. will it be fixed in near future?
@Xepe maybe you can add here the customCompiler example ?