Page Contents

Home > @loopback/metadata > DecoratorFactory > withTarget

DecoratorFactory.withTarget() method

Set a reference to the target class or prototype for a given spec if it’s an object

Signature:

withTarget(spec: T, target: Object): T;

Parameters

Parameter Type Description

spec

T

Metadata spec

target

Object

Target of the decoration. It is a class or the prototype of a class.

Returns:

T