static/jsvm/classes/DynamicModel.html
DynamicModel creates a new dynamic model with fields from the provided data shape.
Caveats:
-0).model.roles and not model.Roles even if in the model shape and in the DB table the column is capitalized).get(key) (e.g. model.meta.get('something')).null*() helpers - nullString(), nullInt(), nullFloat(), nullBool(), nullArray(), nullObject().Example:
const model = new DynamicModel({ name: "" // or nullString() if nullable age: 0, // or nullInt() if nullable totalSpent: -0, // or nullFloat() if nullable active: false, // or nullBool() if nullable Roles: [], // or nullArray() if nullable; maps to "Roles" in the DB/JSON but the prop would be accessible via "model.roles" meta: {}, // or nullObject() if nullable})Copy
Optional shape: { key: string: any; }-
OSLightDark
Generated using TypeDoc