One query is bothering me - I am attempting to create my own version of Injectable and I need to determine if a specific decorator exists in my Class. Is there a way to list all decorators of a class? Let's take the example below. All I want to know is whether "myDecorator" is present as a decorator in MyClass or not.
function myDecorator(ctor: Function):void{
console.log(ctor)}
@myDecorator
class MyClass{
static isInjectable: boolean;
public a: number = 5;
constructor() {
this.a = 5;
}
}
I wonder if using the Reflect-API could help solve this problem, although I haven't figured out how to use it properly yet.