Search code examples
ember.jsember-data

ember-data: How to tell if a model's async: true relationship is loaded without triggering a load?


I need to check if an async relationship has been loaded without triggering the load, is this possible?


Solution

  • There is no official way to accomplish this yet, but unofficially you can do

    // this will be null if not loaded, and populated if it has at least started loading
    if(model._relationships.yourRelationshipName) {...}