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()    
createDecorator(key, spec, options) static Create a method decorator function
mergeWithInherited(inheritedMetadata, target, methodName, methodDescriptor) protected  
mergeWithOwn(ownMetadata, target, methodName, methodDescriptor) protected