Error: No component factory found for TermsConditions

Ashutosh Singh picture Ashutosh Singh · Sep 9, 2016 · Viewed 11.2k times · Source

I am getting this Error:

No component factory found for TermsConditions while using angular2-rc6.

My route map is like this:

{
    path: '',
    component: TermsConditions
}

Answer

Ashutosh Singh picture Ashutosh Singh · Sep 10, 2016

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 {}
  1. Import this module to your root module.

       @NgModule({ 
          declarations : [ AppComponent ],
          imports: [ BrowserModule, TermsConditions ],
          bootstrap: [ AppComponent ]
        }) 
        export default class AppModule {}
    
  2. 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.