我收到此错误:
No component factory found for TermsConditions while using angular2-rc6.
我的路线图是这样的:
{
path: '',
component: TermsConditions
}
最佳答案
感谢您的帮助。我知道如何解决这个问题。
No component factory found for TermsConditions.
@NgModule({
declarations : [ TermsConditionsComponent ]
})
export default class TermsConditions {}
将此模块导入到您的根模块。
@NgModule({ declarations : [ AppComponent ], imports: [ BrowserModule, TermsConditions ], bootstrap: [ AppComponent ] }) export default class AppModule {}
在路由中使用组件。
{ path : 'terms', component : TermsConditionsComponent } `
这意味着您的模块在应用程序范围内不可用,这就是您的组件未绑定(bind)到路由器的原因。
关于angular - 错误: No component factory found for TermsConditions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39415903/