---
lang: en
title: 'API docs: metadata.classdecoratorfactory.createdecorator'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
editurl: https://github.com/strongloop/loopback-next/tree/master/packages/metadata
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`


