Questions tagged [angular-ngrx-data]

John Papa and Ward Bell's Zero Ngrx Boilerplate - You may never write an action, reducer, selector, effect, or HTTP dataservice again.

120 questions
3
votes
1 answer

Entity removed from cache despite error on DELETE

I am using Angular 8 with @ngrx/data to manage my entities. When I initiate a delete operation which fails (server returns 500), the entity is removed from the ngrx client side cache, despite it not being deleted on the server. How do I prevent the…
Aviad P.
  • 32,036
  • 14
  • 103
  • 124
2
votes
0 answers

Injection Token Provider definition for Lazy Loaded Module not working

I have defined a module for data access in my angular application and I am using NgRx/Data. The Module hierarchy looks like this: AppModule Customer-Module (LazyLoaded) -> Imports Customer-Data-Module Within my Customer-Data-Module I have set the…
Weissvonnix
  • 731
  • 7
  • 23
2
votes
1 answer

What's the right version of Angular to use that supports ngRx/data?

I'm trying to build a project (https://www.learmoreseekmore.com/2021/07/ngrx-v12-an-angular-state-management-using-ngrx-data.html) that uses ngRx/data. I have the following version of Angular installed $ ng --version _ _ …
Dave
  • 15,639
  • 133
  • 442
  • 830
2
votes
2 answers

While implementing ngrx Observable is showing Object of unknown type

This is my component's typescript code: import { Component, Input, OnInit } from '@angular/core'; import { Store } from '@ngrx/store'; import { Observable } from 'rxjs'; @Component({ selector: 'app-counter-output', templateUrl:…
2
votes
1 answer

ngrx/data add new property to existing collection

I'm currently using NgRx/data and I have 2 collections: Courses and Lessons. I found something in their documentation to overwrite EntityCollectionReducer: @Injectable() export class AdditionalEntityCollectionReducerMethodsFactory { …
Sergiu Molnar
  • 865
  • 1
  • 11
  • 22
2
votes
1 answer

How can I use entityActionFactory in action files for customizing actions in ngrx/data?

I saw we can customize our actions in ngrx/data like below https://ngrx.io/guide/data/entity-actions#tagging-the-entityaction Therefore, my question is how could I create these customized actions in the normal ***.actions.ts files (example) import…
ackuser
  • 5,681
  • 5
  • 40
  • 48
2
votes
1 answer

Angular + Ngrx : best practice to select a value in component and in function

I have pretty much the same question as in ngrx get value in function , but I'm wondering if the answer (see comment in that topic) is still the best practice nowadays. My situation is: I want to get 2 values from the store to show in my component…
bits
  • 672
  • 2
  • 7
  • 26
2
votes
0 answers

How to extend EntityCollectionReducerMethods NgRx Data

I need to parse the data field before adding it to the store. I was hoping to parse the data field from the override getAll(). This code doesn't work can someone explain why ? export interface Alert { id: string; data: any; } const…
Brett
  • 1,717
  • 1
  • 26
  • 38
2
votes
1 answer

Ngrx Data - extending DefaultDataService

I am trying to extend the ngrx/data DefaultDataService and override some methods. What I have to change in the methods is the entityUrl and I have to send an HttpParam (to tell the interceptor which BE service should be used for the specific Http…
balintd
  • 93
  • 7
2
votes
1 answer

How can I configuration NgRx data that I would like to exchange data, not merge?

How can i configuration ngrx/data that when i call getAll (example) 10 seconds intervall from entityService what use http. I would like change all (remove all not exist data). I experience it will merge and not remove what already dont exist. If…
Numichi
  • 926
  • 6
  • 14
2
votes
3 answers

ngrx/data: best way to have multiple api roots?

I would need to target different api endpoint roots from different angular modules. For example http://server:port/user-api from User module http://server:port/admin-api from Admin module http://server:port/checkout-api from Cart module and so…
2
votes
1 answer

NGRX data: EntityServicesBase constructor accepts only one argument

I try to create a Sub-class EntityServices for application class convenience according to the NGRX/data documentation at https://ngrx.io/guide/data/entity-services#sub-class-entityservices-for-application-class-convenience Unfortunately the provided…
Rias
  • 1,956
  • 22
  • 33
2
votes
1 answer

obtain the result or HTTP response of an add operation of ngrx/data

As described in the entity dataservice documentation , the add operation expects an entity to be saved on the backend. What it doesn't say is that it expects the created entity to be returned from the backend (with an ID etc). My backend does that…
user12207064
2
votes
1 answer

NGRX/data entity getAll concats old data with new instead of updating

I am trying to use ngrx-data-lab as an example for my project. Here's is the stackblitz of project I used. I can't use the actual url of the server that I am using. The url belongs to my company. But what is happening is that the server is returning…
GreedyAi
  • 2,709
  • 4
  • 29
  • 55
2
votes
0 answers

@ngrx/data custom DataService - NullInjectorError: No provider for String

I am trying to add a new custom DataService to @ngrx/data I am extending DefaultDataService class through custom-entity-data-service.ts and then registering it to entityService to get the service as DI custom-entity-data-service.ts Step 1 - Define…
maxkart
  • 619
  • 5
  • 21