Is it possible to access an injected service from within a Class decorator?
I want to get the service within the custom constructor:
function CustDec(constructor: Function) {
var original = constructor;
var f: any = function (...args) {
// I want to get injectedService here. How?
// I've tried things like this.injectedService but that doesn't work
return new original(...args);
}
f.prototype = target.prototype;
return f;
}
@CustDec
@Injectable()
class MyService {
constructor(
private readonly injectedService: InjectedService,
) {}
}