0
在路線中訪問模型兒童的最佳方式是什麼?訪問模型中兒童的最佳方式
路線代碼:
this.store.find('Parent', params.parent_id).then(function(parent){
//this works
var a = parent._data.children.length;
//this doesn't but feels like it should?
var a = parent.get('children').length;
})
型號:
App.Parent = DS.Model.extend({
...
children: DS.hasMany('child', {async: true}),
});
Doh ...謝謝你是這樣的。 – TrevTheDev