Greetings,
I am searching for a method to define a class in TypeScript and retrieve its value from within the parent.
abstract class Base{
fetchCollectionName(): string{
// code here to return child class attribute value
}
}
@CollectionName('person')
class Child extends Base{
name: string;
}
const c = new Child();
console.log(c.fetchCollectionName()) // person
Can this be accomplished?
Appreciate it