Model

model. Model

new Model(modelDefinition)

Source:

A Model represents an object from the DHIS2 Api. A model is created based of a ModelDefinition. The ModelDefinition has the properties that the model should have.

Parameters:
Name Type Description
modelDefinition ModelDefinition

The model definition that corresponds with the model. This is essential defining what type the model is representing.

Extends

  • ModelBase

Methods

(static) create(modelDefinition) → {Model}

Source:

The static method is a factory method to create Model objects. It calls new Model() with the passed ModelDefinition.

let myModel = Model.create(modelDefinition);
Parameters:
Name Type Description
modelDefinition ModelDefinition

ModelDefinition from which the model should be created

Returns:

Returns an instance of the model.

Type
Model