Based on ngrx docs we should have 3 entity collection services.
Or later based on ngrx docs
we may have 3 own services which extend
ngrx-entity-relationship both will work.
What we should keep in mind is that
@ngrx/data is built on services.
Therefore, our selectors for related entities should be provided via services too.
So, let's simply create a service that injects the services as dependencies, and defines root selectors which return entities with relationships.
The approach is the same as for
relatedEntity functions from
but instead of defining selectors in files, we should define them in the service.
Besides single users, we can select an array of users.
For that, we need
Now, to use the selectors, we need to inject the created service with root selectors in desired components: