[ ] Regression
[ ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
I write a Log decorator which can apply to a method
/**
log the method execute
/
export const Log = () => {
return (target, name, descriptor: PropertyDescriptor) => {
const { value: method } = descriptor
/
* just log
*/
descriptor.value = function(...args){
console.log('before method call')
const result = method.call(target, ...args)
console.log('after method call')
return result
}
}
}
but when i apply it to a Injectable class, i missing the properties of that object,but apply to the controller class is ok
Nest version: X.Y.Z
For Tooling issues:
- Node version: XX
- Platform:
Others:
Please, provide a minimal reproduction of this issue.
@kamilmysliwiec I have found the problem,it's my fault ,the target is not the class instance,it is the class prototype锛宻o i can not get the property of the class instance
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
@kamilmysliwiec I have found the problem,it's my fault ,the target is not the class instance,it is the class prototype锛宻o i can not get the property of the class instance