angularngrxangular-elementsangular-ngrx-datangrx-data

Inject a Provider into an Angular Element (NGRX)


I keep getting the below error in my browser after I compile an Angular element that is using NGRX data:

enter image description here

I attempted adding and removing EntityCollectionServiceElementsFactory to the providers in every NgModule in the NGRX data app without any success (there are two modules).

I have a hypothesis that I need to add my entity NGRX services to the injector somehow, but I do not have an example on how to do so.

I have been messing with this for days now and I cannot figure it out.

My source code is below:

enter image description here

Here is an example of one of my NGRX data entity services:

enter image description here

Please help and thank you.


Solution

  • enter image description here

    Turns out that angular elements inherit from their parent NgModule. Even though in the NGRX Data docs they tell you to add all store related modules to the app.module.ts, that will not work with an Angular element if all of the element's code is in a separate NgModule (unless all code related to your element is in the app module.