Guest User

Untitled

a guest
Jan 16th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. ```
  2. target : any 
  3. propertyKey : string
  4. descriptor: PropertyDescriptor 
  5. ```
  6.  
  7. ## target 
  8.  
  9. means the instance of the class where we are applying this decorator.
  10. This object is very helpful in order to maintain the context of the method.
  11. You will use target to call the original method with respect to its context. 
  12. In our below example target value would be instance of the calculator class.
  13.  
  14. ## propertykey
  15.  
  16. This is the name of the method where we are applying decorator. In our below example propertykeywill be add method name.
  17.  
  18. ## descriptor
  19. This is a complex object it contains metadata about the method where decorator is applied.
Add Comment
Please, Sign In to add comment