Support for entryComponents?
See original GitHub issueI am trying to add a component to my UI-Jar project that creates another component dynamically, and as such requires that I add that dynamically created component to the module’s entryComponents
array. Obviously there isn’t support for entryComponents
in TestBed.configureTestingModule
, but I’ve had success in the past in my normal unit test spec files by doing the following after calling compileComponents()
.
TestBed.overrideModule(BrowserDynamicTestingModule, {
set: {
entryComponents: [ SomeDynamicComponent ]
}
});
I tried doing that in my ui-jar specfile but am still getting the following error:
Error: No component factory found for SomeDynamicComponent. Did you add it to @NgModule.entryComponents?
Is this intended to be supported? Any insight into why it is not working, or what I could do differently?
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Entry components - Angular
An entry component is any component that Angular loads imperatively, (which means you're not referencing it in the template), by type. You specify...
Read more >Bye-Bye entryComponents?. With angular 9, there ... - Medium
In this blog post, I will try to cover everything that might help you clear up all the thoughts you have around the...
Read more >What is entryComponents in angular ngModule?
entryComponent is any component Angular loads imperatively. You can declare entryComponent by bootstrapping it in NgModule or in route ...
Read more >Add support for entryComponents · Issue #100 · testing-library ...
Pinning the angular dependencies to 9.1.4, calling ngcc with --properties main and running the tests again it seems like Ivy is used correctly....
Read more >Entry Components in Angular - What are they? - Coding Latte
In this post, we are going to look at Entry Components (loaded by Class and not selector) in Angular, what they are and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@thomasbottonari That’s a bug, I created #36. A workaround is to declare your “PopoverModule” outside the test file, then it will be defined correct.
I was able to get this working. Basically, you have to create another TestEntryModule with the declaration,export, and entry components.
And then import this TestEntryModule in your TestModule.