Event listeners registered for this instance.
Unique identifier for the instance.
The errors associated with the model.
The initial fields of the model.
Indicates whether the class is currently loading.
Gets the class name of this instance.
Checks if the model is valid.
Emits an event by name to all registered listeners on that event.
Listeners will be called in the order that they were added. If a listener
returns false
, no other listeners will be called.
The name of the event to emit.
Rest
...args: any[]The context of the event, passed to listeners.
Validates the model and makes a request if validation passes.
The payload for the request.
The context for validation.
The request function.
Retrieves the validation object.
The context for validation (unused).
// Validation object is an object that should be written in such way:
// validation passes if the property function return empty string
// prop is a name of your class properties that should be validated
{
prop: () => {
if (someCondition) {
return 'error message';
}
return '';
}
}
Generated using TypeDoc
Represents a base model with common functionality.