Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4830

A belongsTo child model from parent model using get method is not of DS.Model type

$
0
0

@Santosh_Pandey wrote:

Hi, 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

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4830

Trending Articles