Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Latest commit

 

History

History
17 lines (14 loc) · 512 Bytes

models.md

File metadata and controls

17 lines (14 loc) · 512 Bytes

Models allow you to define what data may look like when you retrieve it from an API. This also allows you to write functions to do multiple things to the model such as setting default values or displaying some of the information.

    import Model from "varie/lib/support/Model";

    export default class UserModel extends Model {
        public id : number;
        public name : string;
        public email : string

        protected defaults() {
            this.name  = 'Varie';
        }
    }