Error: No component factory found for TermsConditions

Error: No component factory found for TermsConditions

我收到这个错误:

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 {}
  1. 将此模块导入您的根模块。

       @NgModule({ 
          declarations : [ AppComponent ],
          imports: [ BrowserModule, TermsConditions ],
          bootstrap: [ AppComponent ]
        }) 
        export default class AppModule {}
    
  2. 像路由一样使用组件。

    { 
      path : 'terms',
      component : TermsConditionsComponent
    }
    `
    

这意味着您的模块在应用程序范围内不可用,这就是您的组件未绑定到路由器的原因。

您需要在 declarationsentryComponents 部分列出条款条件。