0

I'm using this SO answer to create dynamic tabs:

Angular dynamic tabs with user-click chosen components

I'm getting this error:

No component factory found for C1. Did you add it to @NgModule.entryComponents?

There is a page on SO which suggests how to fix this problem:

Angular 4: no component factory found,did you add it to @NgModule.entryComponents?

I've tried the proposed solutions there and I can't get rid of this error.

My application is structured with submodules, which I think might have something to do with why this solution doesn't work. Here is what I've tried specifically:

  • Added C1 to both "declarations" and "entryComponents" in my submodule
  • Exported C1 from the submodule, imported the submodule into app.module, and added C1 to both "declarations and "entryComponents" in my app.module

Neither of these work. Any suggestions on what I could try now or maybe some suggestions on how to get specific information on what is actually failing?

jb44
  • 393
  • 1
  • 6
  • 23
  • You put this component in declarations and exports of his father module ? – Vitor Piovezam Jun 18 '19 at 01:17
  • I tried both ways - putting declarations and entryComponents into the module that contains all the code (which I believe is lazy loaded). I also tried exporting from module that contains all the code (so that app.module could see the components) and adding entryComponents to app.module. Neither works. – jb44 Jun 18 '19 at 12:23

0 Answers0