问题
I am getting this Error:
No component factory found for TermsConditions while using angular2-rc6.
My route map is like this:
{
path: '',
component: TermsConditions
}
回答1:
Thanks for your help. I got to know how to fix this issue.
No component factory found for TermsConditions.
@NgModule({
declarations : [ TermsConditionsComponent ]
})
export default class TermsConditions {}
Import this module to your root module.
@NgModule({ declarations : [ AppComponent ], imports: [ BrowserModule, TermsConditions ], bootstrap: [ AppComponent ] }) export default class AppModule {}
use component in routing like.
{ path : 'terms', component : TermsConditionsComponent } `
It means your module is not available in application scope that is why your component is not being bind to router.
回答2:
You need to list the TermsConditions in both the declarations
and entryComponents
section.
https://stackoverflow.com/a/39376857
来源:https://stackoverflow.com/questions/39415903/error-no-component-factory-found-for-termsconditions