abstract class Abstract {
protected name: string;
constructor () {
this.abstractMethod();
}
protected abstract abstractMethod (): void;
}
class Concrete extends Abstract {
protected name: string = 'Concrete';
protected abstractMethod () {
console.log(this, this.name); // Concrete, undefined
}
}
new Concrete();