Methods
Usage
These methods can be used to read and write your data:
Asynchronous Methods
async load()
- load model dataasync save()
- save model data
Synchronous Methods
create(data)
- create a recorddelete(id)
- delete a recordget(id)
- get a recordtoArray()
- convert records to arrayupdate(id, data)
- update a record
Example
export class InstrumentModel extends Model {
async load(): Promise<InstrumentModel> {
return super.load();
}
async save(): Promise<InstrumentModel> {
return super.save();
}
create(data: IInstrumentModel): IInstrumentModel {
return super.create(data);
}
delete(id: string): IInstrumentModel {
return super.delete(id);
}
get(id: string): IInstrumentModel {
return super.get(id);
}
toArray(): IInstrumentModel[] {
return super.toArray();
}
update(id: string, data: IInstrumentModel): IInstrumentModel {
return super.update(id, data);
}
}
Updated about 6 years ago