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

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

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [model](./repository.model.md)

## model() function

Decorator for model definitions

<b>Signature:</b>

```typescript
export declare function model(definition?: Partial<ModelDefinitionSyntax>): (target: Function & {
    definition?: ModelDefinition | undefined;
}) => void;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  definition | <code>Partial&lt;ModelDefinitionSyntax&gt;</code> |  |

<b>Returns:</b>

`(target: Function & {
    definition?: ModelDefinition | undefined;
}) => void`

A class decorator for `model`


