src/model.js
function save() {
        var res = this;
        res.$created = true;
        return this.$loc.$save(this.$toObject()).then(function() {
          emitter.emit('updated', res);
          if (!res.$resolved) {
            res.$deferred.resolve(res);
            res.$resolved = true;
          }
          return res;
        });
      }
function save() {
        var res = this;
        res.$created = true;
        return this.$loc.$save(this.$toObject()).then(function() {
          emitter.emit('updated', res);
          if (!res.$resolved) {
            res.$deferred.resolve(res);
            res.$resolved = true;
          }
          return res;
        });
      }
function save ( ) { var res = this ; res . $created = true ; return this . $loc . $save ( this . $toObject ( ) ) . then ( function ( ) { emitter . emit ( 'updated' , res ) ; if ( ! res . $resolved ) { res . $deferred . resolve ( res ) ; res . $resolved = true ; } return res ; } ) ; }
The promise resolves once the save has been committed
The promise resolves once the save has been committed