mercredi 7 novembre 2018

Ember 3.5 BelongsTo Relationships not Resolving

i used to have emberjs 1.13 which i upgraded to 3.5 i got an issue with belongsTo relationships where i cannot access those data in it. my code as below

model

export default DS.Model.extend( {

  peoplesoftId: DS.attr( 'string' ),
  title: DS.attr( 'string' ),
  description: DS.attr( 'string' ),
  published: DS.attr( 'boolean' ),
  publishedAt: DS.attr( 'date' ),

  course: DS.belongsTo( 'course' ),
  author: DS.belongsTo( 'profile', { async: true } ),

  viewed: false,
  isNew: true,

}

in controller

this.get('model.published') working 
this.get('model.author.name') not working 

but the same code was working on 1.13 of emberjs




Aucun commentaire:

Enregistrer un commentaire