I am using Dynamic Components and I am re-writing this to try to better explain.
AppModule
My App Module contains an entryComponents array which contains these 2 things
ContainerComponentTextComponent
Now I can go crazy until my heart is content
GameModule
However, now I have a problem. Some of my Components are Games and they are heavy and indeed they may never be used. Therefore, I have to have Lazy Loaded routes. GameModule has the following
GameContainerGameComponent
So now I am in this place:
And what I am actually aiming for is this:
My problem is with that GameContainer. Originally it was a DynamicComponentService but I couldn't use this because of circular dependencies with nested containers. See my recent question where I moved this out of a service and back into Container.
The problem is that I can't seem to successfully extend Container. I was hoping I could do this:
protected constructComponent(config: IThing){
switch (config.selector){
default:
// `app-text` will be handled
return super.constructComponent(config);
// my module extends with this new capability
case `app-game-component`:
return this.createGameComponent(config);
}
}
But that doesn't work, my overrided constructComponent never appears to be called on my GameContainer. So that idea went out of the window.
Will Angular Elements help me?
My biggest problem at the moment is figuring out how to correctly deal with these 2 sets of entryComponents. I have ran out of options or strategy.
Then I read an article about AngularElements and what I am really wondering is if this may aid me here? When I use AngularElements is it possible to register all my components at the App level so that my single Container has access to all "Factories" but yet still benefit from lazy loading?
Angular is saying "Look man, I don't know what app-game is" and this is causing me all kinds of nightmares since even when I load it, I now have some injector in some other place and I can't seem to deal with it.



Containeris aScreenit will contain Decorators and appears to become mirky