Ember-data lazy load association with “links” attribute

前端 未结 1 1015
粉色の甜心
粉色の甜心 2021-02-08 21:47

I have a model Teacher which has many Students. The models are defined as follows:

App.Teacher = DS.Model.extend({
  email: DS.attr(\'string\'),
  students: DS.h         


        
相关标签:
1条回答
  • 2021-02-08 22:29

    Ok, I found the answer. I had to add a property async: true to the students association in the model for Teacher:

    App.Teacher = DS.Model.extend({
      email: DS.attr('string'),
      students: DS.hasMany('student', { async: true })
    });
    
    0 讨论(0)
提交回复
热议问题