NgrxData,如何在DefaultDataService <T>中添加默认功能以外的自定义功能

问题描述

我正在尝试使用NgRXData(https://ngrx.io/guide/data)构建应用程序,并且想在其中一个模型的DataService中添加新功能,我知道您只能覆盖存在于其中的现有功能。 DefaultDataService<T>https://ngrx.io/api/data/DefaultDataService),但是即使我刚刚这样做,也无法为其添加额外的新功能:

export class MyCustomDataService extends DefaultDataService<MyModel> {
  constructor(http: HttpClient,httpUrlGenerator: HttpUrlGenerator,logger: Logger) {
    super('MyModel',http,httpUrlGenerator);
    logger.log('Created custom MyModel EntityDataService');
  }

  getAll(): Observable<MyModel[]> {
    return super.getAll().pipe(map(lst => lst.map(model => this.mapMyModel(model))));
  }
  
  newFunction(): Observable<MyModel> {
     // just get the data and map it.
  }

newFunction是否将链接到要更新的商店?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)