Page Contents
Home > @loopback/metadata > ClassDecoratorFactory > createDecorator
ClassDecoratorFactory.createDecorator() method
Create a class decorator function
Signature:
static createDecorator<S>(key: MetadataKey<S, ClassDecorator>, spec: S, options?: DecoratorOptions): ClassDecorator;
Parameters
| Parameter | Type | Description |
|---|---|---|
| key | [MetadataKey](/doc/en/lb4/apidocs.metadata.metadatakey.html)<S, ClassDecorator> | Metadata key |
| spec | S | Metadata object from the decorator function |
| options | [DecoratorOptions](/doc/en/lb4/apidocs.metadata.decoratoroptions.html) | _(Optional)_ Options for the decorator |
Returns:
ClassDecorator