[Typescript] Abstract Classes
You cannot create a instance of abstract class. An abstract class mean to be extended.
abstract class Size {
constructor(public sizes: string[]) {}
set availableSizes(sizes: string[]) {
this.sizes = sizes;
}
get avaialableSizes() {
return this.sizes
}
}
new Sizes(['small']) // Error: Cannot create an instance of the abstract class 'Sizes'