Checks if the Model is new or not. The id field is used to determine if a model instance is new or existing. If the value of the specified field is equal to the default value that is specified through the fields configuration, the model is considered new.


Boolean—Returns true if the field is editable. Otherwise, returns false.

Example - check if a model is new

var Product ={
    id: "productId",
    fields: {
        productId: {
            editable: false
var productOne = new Product();
console.log(productOne.isNew()); // outputs "true"
var productTwo = new Product({ productId: 1 });
console.log(productTwo.isNew()); // outputs "false" because productId is set to 1
In this article
Not finding the help you need? Improve this article