Angular-扩展服务并使用其方法

时间:2019-03-14 10:30:16

标签: angular typescript

我正在尝试扩展一项服务,并且已经通过以下方式进行了扩展:

@Injectable({
    providedIn: 'root'
})
export class CatService extends productservice
{
    static ngInjectableDef = undefined; 
    constructor(cacheservice : CacheService , a: ForceService, b: AicService, c: MetadataService, d: Configuration, e: AParser, f: Injector){
      super(cacheservice,a,b,c,d,e,f);  
    }
    public globalFilter() : Observable<AFilter[]>
    { 
        return Observable.of([new AFilter(this.type, [new ACondition(this.type, "IsHidden", "Equal", !1)], [new AFilter(this.type, [new ACondition(this.type, "AncestorId", "NotNull", null), new ACondition(this.type, "PrimordialId", "NotEqual", null)], null, "AND")])]);
    }
}

在我的app.module.ts中

providers:[CategoryService,CatService]

现在,当我运行应用程序时,出现以下错误:

  

未捕获(承诺):错误:
  StaticInjectorError(AppModule)[CatService-> function(){
      ]:
        StaticInjectorError(平台:核心)[CatService-> function(){
      ]:
          NullInjectorError:没有提供function(){

的提供者

0 个答案:

没有答案