Ember data write register isLoaded

Can someone explain to me why the RecordArray isLoaded parameter is set to true before even the success method is called when ajax is called.

From source code ember-data p>

  findAll: function(store, type, since) { var root = this.rootForType(type); this.ajax(this.buildURL(root), "GET", { data: this.sinceQuery(since), success: function(json) { debugger; Ember.run(this, function(){ this.didFindAll(store, type, json); }); } }); }, 

Defined in view

 handler: function() { var content, controller = this.get('controller'); if(controller.get('content.isLoaded')) { } }.observes('controller.content.isLoaded') 
+6
source share
2 answers

There seems to be a persistent error with isLoaded properties set prematurely in collections. Here is the related issue on GitHub.

+4
source

For those using the old version of Ember: I found that if you wrap everything you do with Ember.run.next , the content will be loaded by then.

Not the nicest solution, but it worked for me in Ember v1.0.

0
source

All Articles