Angular @ngrx/数据自定义数据服务-NullInjectorError:没有字符串的提供程序

Angular @ngrx/数据自定义数据服务-NullInjectorError:没有字符串的提供程序,angular,angular-ngrx-data,Angular,Angular Ngrx Data,我正在尝试向@ngrx/data添加一个新的自定义数据服务 我正在通过custom-entity-data-service.ts扩展DefaultDataService类,然后将其注册到entityService以将服务作为DI custom-entity-data-service.ts 步骤1-定义服务 simple.component.ts 步骤3-在组件中使用它 我认为这个错误是由于一些依赖项注入造成的,但无法弄清楚。如有任何建议,将不胜感激 谢谢entityName:string在服务的

我正在尝试向@ngrx/data添加一个新的自定义数据服务

我正在通过custom-entity-data-service.ts扩展DefaultDataService类,然后将其注册到entityService以将服务作为DI

custom-entity-data-service.ts

步骤1-定义服务 simple.component.ts

步骤3-在组件中使用它 我认为这个错误是由于一些依赖项注入造成的,但无法弄清楚。如有任何建议,将不胜感激


谢谢

entityName:string在服务的构造函数中:-这是其中一个模块中的可注入/提供者吗?你说得对,我真傻。谢谢
import { Injectable } from '@angular/core';
import { DefaultDataService, HttpUrlGenerator, DefaultDataServiceConfig } from '@ngrx/data';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { SharepointService } from 'dnp-sharepoint';

// @Injectable() << NOTE - this commented out
export class SharePointEntityDataService extends DefaultDataService<any>{

  constructor( entityName: string,  http: HttpClient, 
     httpUrlGenerator: HttpUrlGenerator, config: DefaultDataServiceConfig, private sharePoint: SharepointService) {
    super(entityName, http, httpUrlGenerator, config);
}
  
getAll(): Observable<any[]>{
  console.log('calling for ',this.entityName);
  return this.sharePoint.getAll(this.entityName); // << my custom call 
}

}
@NgModule({
  imports: [
    CommonModule,
    HttpClientModule,
    StoreModule.forRoot({}),
    EffectsModule.forRoot([]),
    EntityDataModule.forRoot(entityConfig),
    environment.production ? [] : StoreDevtoolsModule.instrument(),
  ],
  providers: [Store, SharePointEntityDataService]
})
export class AppStoreModule {
  constructor(private entityDataService: EntityDataService, private sharepointEntityDataService: SharePointEntityDataService) {
    this.entityDataService.registerService('Registry', this.sharepointEntityDataService);
  }
}
  constructor(private registryService: RegistryService, private entityDataService: EntityDataService, 
    private sharePointDataService: SharePointEntityDataService) { 
      this.registryService.getAll().subscribe(obj=>console.log('ger all ...',obj));
    }
ERROR Error: Uncaught (in promise): NullInjectorError: StaticInjectorError(AppModule)[SharePointEntityDataService -> String]: 
  StaticInjectorError(Platform: core)[SharePointEntityDataService -> String]: 
    NullInjectorError: No provider for String!
NullInjectorError: StaticInjectorError(AppModule)[SharePointEntityDataService -> String]: 
  StaticInjectorError(Platform: core)[SharePointEntityDataService -> String]: