ember.js - Ember data hasMany records loaded only in the canonicalState property -


my application's index route gets data server using ember.$.getjson(url) in route's model hook. response pushed store using pushpayload method. when foo.get('bars') foo has many bars (still in model hook), results in empty bars. seen server's response , ember inspector though, the foo's bars have data. investigated foo.get('bars') using chrome's console, , found out the bar records loaded in canonicalstate property. workaround use foo.get('bars.canonicalstate') instead.

so far working good, since feels hacky , can't find canonicalstate property in ember's documentation, know if right way of doing it? , why happen?

in controller, try following...

... mybars: ember.computed.map('foo.bars', function(bar) { return bar; }), ... 

then should able access mybars constructed array of bar objects.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -