我有一个TypeIdentifierService
类来扩展另一个类,
在TypeIdentifierService
类中,我注入了ConfigService
,并在super方法中使用了此服务,但它向我显示了此错误
在访问a的构造函数中的'this'之前,必须先调用'super' 派生类。
@Injectable()
export class DataService<T> {
constructor(
@Inject('API_BASE_URL') protected url: string,
protected httpClient: HttpClient,
protected responseHandler: HttpResponseHandler
) { }
}
@Injectable()
export class TypeIdentifierService extends DataService<Dictionary> {
constructor(httpClient: HttpClient, responseHandler: HttpResponseHandler, private config: ConfigService) {
super(`${this.config.getSettings('environment.serviceBaseUrl.sp')}/typeIdentifiers`, httpClient, responseHandler);
}
}