Ember-Data, how to find out when an object is received

What is the best way to find out when an object was retrieved from remote storage in ember data?

I need to make a call to retrieve the data, but I need some values ​​from the selected ember-data object.

I am currently using this approach, but I am sure there is a better way.

contactLoaded: function(){
  if(!this.getPath('contact.isLoaded')){
    return;
  }

  //make call
}.observes('App.contact.isLoaded')
+5
source share
2 answers

I am afraid that this is the only way to achieve your goal, today ...: - /

+3
source

You can also do

model.one('didLoad', function() {
   alert("I LOADED!";
});

Replace didLoad with didCreate, didUpdate, etc., depending on your asynchronous event you are looking for.

one , didLoad . on .

+1

All Articles