UNPKG

@loopback/docs

Version:

Documentation files rendered at [https://loopback.io](https://loopback.io)

36 lines (23 loc) 1.11 kB
--- lang: en title: 'API docs: repository.modeldefinition.addproperty' keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI sidebar: lb4_sidebar editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/repository permalink: /doc/en/lb4/apidocs.repository.modeldefinition.addproperty.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [ModelDefinition](./repository.modeldefinition.md) &gt; [addProperty](./repository.modeldefinition.addproperty.md) ## ModelDefinition.addProperty() method Add a property <b>Signature:</b> ```typescript addProperty(name: string, definitionOrType: PropertyDefinition | PropertyType): this; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | name | string | Property definition or name (string) | | definitionOrType | [PropertyDefinition](./repository.propertydefinition.md) \| [PropertyType](./repository.propertytype.md) | Definition or property type | <b>Returns:</b> this