UNPKG

@loopback/docs

Version:
35 lines (22 loc) 956 B
--- lang: en title: 'API docs: repository.modeldefinition.addproperty' keywords: LoopBack 4.0, LoopBack 4 sidebar: lb4_sidebar 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 | <code>string</code> | Property definition or name (string) | | definitionOrType | <code>PropertyDefinition &#124; PropertyType</code> | Definition or property type | <b>Returns:</b> `this`