I have defined an abstract class
I have multiple subclasses to implement abstract methods of abstract classes
export abstract class Base {
doSomeThing() {
}
abstract beforeDo():void;
}
class work extends Base {
beforeDo() {
console.log("work")
}
}
class study extends Base {
beforeDo() {
console.log("study")
}
}
function dd(doo: Base) {
new doo();
}
but I have to report an error when I go to new like this. Please tell me how to deal with this problem-sharp-sharp-sharp topic description
sources of topics and their own ideas
related codes
/ / Please paste the code text below (do not replace the code with pictures)