There's a unique decorator in my code that seems to have no functionality:
export function myDecorator(target: any, key: string) {
var t = Reflect.getMetadata("design:type", target, key);
}
This decorator is being used with properties of a class:
export class SomeClass {
@globalVariable
someProperty: string;
@globalVariable
fakeProperty: number;
}
What I want to achieve now is to retrieve all properties of the class that have been decorated with @globalVariable.
I attempted to use "reflect-metadata" with:
Reflect.getMetadata('globalVariable', this);
However, the result is always "undefined". Is there a way to achieve this using reflect-metadata or am I misunderstanding something?