Constructor
new ModelDefinitions()
- Source:
Example
models.dataElement.getList();
Methods
add(modelDefinition)
- Source:
This will allow you to add your own custom ModelDefinitions.
The Definition object should have the following properties
modelName, modelNamePlural, modelOptions, properties, validations
Example
models.add({name: 'MyDefinition', plural: 'MyDefinitions', endPointname: '/myDefinition'});
Parameters:
Name | Type | Description |
---|---|---|
modelDefinition |
ModelDefinition | Add a model definition to the definitions collection |
mapThroughDefinitions(transformer) → {Array}
- Source:
Map through the modelDefinitions like you would with a simple Array.map()
Example
models.mapThroughDefinitions(definition => console.log(definition.name);
Parameters:
Name | Type | Description |
---|---|---|
transformer |
function | Transformer function that will be run for each |
Returns:
Array with the ModelDefinition
objects.
- Type
- Array