Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember-data RecordArray isLoaded Status

Can any one explain to me why a RecordArray status isLoaded is set to true before even a success method on an ajax call is called.

From ember-data source code

  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 a view

handler: function() {        
    var content, controller = this.get('controller');
    if(controller.get('content.isLoaded')) {
    }
}.observes('controller.content.isLoaded')
like image 235
ken Avatar asked Jan 11 '13 05:01

ken


1 Answers

There appears to be an ongoing bug with isLoaded properties being set prematurely on collections. Here is the relevant issue on GitHub.

like image 66
ahmacleod Avatar answered Nov 15 '22 10:11

ahmacleod