I am trying to access a related(belongsTo) model from the parent model. the structure is as below
employee= DS.Model.extend({ serialNo: DS.attr('number'), name: DS.attr('number'), address: DS.belongsTo('employee/address') });
Now in a component i am receiving this top level employee model and there i am trying to access address model as below. this.get('employee').get('address')
but the address object i received is not of Model type, so i am not able to call any Model function on it. Surprisingly this.get('employee') returns a model object and i am able to call any Model function using it.
Thanks
Aucun commentaire:
Enregistrer un commentaire