DS.Model#reload()

reloadPromise

Defined in addon/-private/system/model/model.js:750

Reload the record from the adapter.

This will only work if the record has already finished loading.

Example

app/routes/model/view.js
import Ember from 'ember';

export default Ember.Route.extend({
  actions: {
    reload: function() {
      this.controller.get('model').reload().then(function(model) {
        // do something with the reloaded model
      });
    }
  }
});

Returns:

Promise
a promise that will be resolved with the record when the adapter returns successfully or rejected if the adapter returns with an error.
doc_EmberJs
2016-11-30 16:50:12
Comments
Leave a Comment

Please login to continue.