I'm using reflect-metadata 0.1.2. I have a parent class as "MyCustom".
export class MyCustom {}
My "Home" component class extend this "MyCustom" class.
@Component({
selector: 'home',
templateUrl: './app/components/home/home.html',
styleUrls: ['./app/components/home/home.css']
})
export class Home extends MyCustom {
}
My intention is to get metadata of all the classes that extend "MyCustom" class using following method call.
let annotations = Reflect.getMetadata('annotations', MyCustom);
The comments on the method Reflect.getMetadata() says,
Gets the metadata value for the provided metadata key on the target object or its prototype chain.
However I get nothing. If I add @Component to "MyCustom" class like below,
@Component({
selector: 'hello'
})
export class MyCustom {}
I get one result that is the annotation on "MyCustom".
Why am I not getting annotations on subclasses ? Any help is highly appreciated.