---
lang: en
title: 'API docs: metadata.classdecoratorfactory.createdecorator'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.metadata.classdecoratorfactory.createdecorator.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/metadata](./metadata.md) &gt; [ClassDecoratorFactory](./metadata.classdecoratorfactory.md) &gt; [createDecorator](./metadata.classdecoratorfactory.createdecorator.md)

## ClassDecoratorFactory.createDecorator() method

Create a class decorator function

<b>Signature:</b>

```typescript
static createDecorator<T>(key: MetadataKey<T, ClassDecorator>, spec: T, options?: DecoratorOptions): ClassDecorator;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  key | <code>MetadataKey&lt;T, ClassDecorator&gt;</code> | Metadata key |
|  spec | <code>T</code> | Metadata object from the decorator function |
|  options | <code>DecoratorOptions</code> | Options for the decorator |

<b>Returns:</b>

`ClassDecorator`


