I have class A in external package
class A {
mess: string;
}
And my property decorator
function test(target: any, propertyKey: string, descriptor: PropertyDescriptor) {
target.propertyKey = 'test';
};
I want to apply my decorator test to class A, but I can't get reflection of class A to apply
test(reflectionOfClassA, attributeKey)
How do I get reflection of class A? I can't update code of class A, because it is imported from other package
Typescript applies experimantal(legacy) decorators like:
So, to apply your decorator programmatically, all you need is to
(you may need to copy the __decorate implementation)