Page Contents

Home > @loopback/metadata > MethodParameterDecoratorFactory

MethodParameterDecoratorFactory class

Factory for method level parameter decorator.

Signature:

export declare class MethodParameterDecoratorFactory<T> extends DecoratorFactory<T, MetadataMap<T[]>, MethodDecorator> 

Extends: DecoratorFactory<T, MetadataMap<T[]>, MethodDecorator>

Example

For example, the following code uses @param to declare two parameters for greet().

class MyController {
  @param('name') // Parameter 0
  @param('msg')  // Parameter 1
  greet() {}
}

Methods

Method Modifiers Description
[create()](/doc/en/lb4/apidocs.metadata.methodparameterdecoratorfactory.create.html)
[createDecorator(key, spec, options)](/doc/en/lb4/apidocs.metadata.methodparameterdecoratorfactory.createdecorator.html) `static` Create a method decorator function
[mergeWithInherited(inheritedMetadata, target, methodName, methodDescriptor)](/doc/en/lb4/apidocs.metadata.methodparameterdecoratorfactory.mergewithinherited.html) `protected`
[mergeWithOwn(ownMetadata, target, methodName, methodDescriptor)](/doc/en/lb4/apidocs.metadata.methodparameterdecoratorfactory.mergewithown.html) `protected`