Official documentation for DS.Model describes:
When i do:
App.Parent = DS.Model.extend({
children: DS.hasMany('child'),
init: function() {
this._super();
this.eachRelationship(function(foo, bar, baz) {
console.log('each relationship', foo, bar, baz);
});
}
});
...it prints out the children
relationship.
However, when i do:
App.Parent = DS.Model.extend({
children: DS.hasMany('child'),
init: function() {
this._super();
console.log('realtionships', this.get('relationships'));
}
});
...it prints undefined
!
Why? How do i access the relationships
property during record initialization, without reverting to the eachRelationship
method?
Demo: http://ift.tt/1xtxvwg
Aucun commentaire:
Enregistrer un commentaire