Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import BusyModule in my module,all routers loadChildren can not use #60

Open
panglisen opened this issue May 26, 2017 · 7 comments
Open

Comments

@panglisen
Copy link

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
image

when use ng serve --prod start
image

i find all loadChildren can not use,

How to solve?

@panglisen
Copy link
Author

my angular version is 4.1.3

@al-pt-old
Copy link
Contributor

al-pt-old commented May 30, 2017

We must not provide Compiler as JitCompiler. Instead we must provide and inject the Compiler2 extends Compiler.
Provide: Compiler2, usefactory: ...

@Xepe
Copy link

Xepe commented Jun 3, 2017

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 tixif-ni@6bdb334

Also I created https://www.npmjs.com/package/tixif-ngx-busy for testing

Regards.

This was referenced Jun 3, 2017
@ipassynk
Copy link

ipassynk commented Jun 8, 2017

@Xepe, can you please explain why do you need to Compiler to make JIT compiler work in AOT?

@Xepe
Copy link

Xepe commented Jun 8, 2017

@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.

@atluri64
Copy link

I am having the same issue. will it be fixed in near future?

@DrMabuse23
Copy link

@Xepe maybe you can add here the customCompiler example ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants