angularangular2-router3

Error: No component factory found for TermsConditions


I am getting this Error:

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

My route map is like this:

{
    path: '',
    component: TermsConditions
}

Solution

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