dimanche 7 août 2016

belongsTo and hasMany not loading in the template

I have these models:

export default DS.Model.extend({
  uid: DS.attr('number'),
  name: DS.attr('string'),
  fullName: DS.attr('string'),
  description: DS.attr('string'),
  homepage: DS.attr('string'),
  owner: DS.attr('string'),
  private: DS.attr('boolean'),
  organization: DS.belongsTo('organization', { async: true })
});

and

export default DS.Model.extend({
  uid: DS.attr('number'),
  avatar: DS.attr('string'),
  blog: DS.attr('string'),
  company: DS.attr('string'),
  login: DS.attr('string'),
  location: DS.attr('string'),
  rooms: DS.hasMany('room', { async: true })
});

in the Ember Inspector I can see the whole data:

enter image description here

both rooms and organizations

when I try to show them in my template:

<div class="row">
    <ul id="room-list">
      
        <li>
          <label>:  () </label>
        </li>
      
    </ul>
  </div>

the () where organization's name should be, is empty, like 53415342: PredictionIO-Enterprise ()




Aucun commentaire:

Enregistrer un commentaire