getModel Method

Get the Model with the specified identifier.

getModel<T extends Model>(modelId: string, modelClass?: EntityClassType<Model>): T

@throws IModelError if the model is not found, cannot be loaded, or fails validation when modelClass is specified.

@see tryGetModel

Parameter Type Description
modelId string The Model identifier.
modelClass EntityClassType<Model> Optional class to validate instance against. This parameter can accept abstract or concrete classes, but should be the same as the template (T) parameter.

Returns - T

Defined in

Last Updated: 14 November, 2024