我有下面的类:传递角服务类和基础类
export class CellLayer extends BaseLayer {
constructor(name: string, type: LayerType, private mapService: MapService) {
super(name, type, mapService);
}
}
和相应的抽象类:
export abstract class BaseLayer implements ILayer {
private _name: string;
private _type: LayerType;
constructor(name: string, type: LayerType, private mapService: MapService) {
this._name = name;
this._type = type;
}
}
全局MapService
对象应传递给这两个类。
不过,我现在收到以下错误:
Types have separate declarations of a private property 'mapService'. (6,14): Class 'CellLayer' incorrectly extends base class 'BaseLayer'.