5. Parameter Decorator
# Typescript Decorator
Medium
Each method in a class can also have its own decorators.
Similar to property decorators, parameter decorators are generally not used alone, but are used in combination with class or method decorators.
Parameters
-
target is the constructor of the class for static members, and the prototype object of the class for instance members.
-
key method name
-
index position in the parameter array
For example, if we need to format the parameters of a method, we can create a decorator specifically for formatting.