Ember-data lazy load association with “links” attribute

前端 未结 1 1013
粉色の甜心
粉色の甜心 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    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)
提交回复
热议问题