I'm using Angular 13 and ngrx/data, store and entity (v.13). I have set up my ngrx/data service
export class MyObjService extends DefaultDataService<MyObject> {
...
}
and then a component using PrimeNg. I have a table to display all my objects ...
<p-table #dt [value]="(myObjects$ | async)!" ...
In which the service file contains
constructor(
...
private service: MyObjService,
) {
...
this.myObjects$ = this.service.getAll();
The issue is every time I do an operation that alters the backend store, for example a delete
del(id: number){
this.myObjService.delete(id)
.subscribe(_ => {
this.MyObjects$ = this.myObjService.getAll();
} );
I have to refresh the table (I have to call "this.myObjects$ = this.myObjService.getAll();" above). Is there a way I can set the table so that the data in the table refreshes automatically? I feel like this is something ngrx/data would allow me to do but not sure how it is done.