问题
With this post, I learned that I can use find
in the console. But I'm having some problems using this to look up the data in my litte jsbin Ember.js with Ember Data and LSAdapter App here.
- Please add some orgs
- Please open your chrome console to see more details.
- Please type in
App.container.lookup('store:main').find('org').toArray()
Why does it show an empty array???
Thank you so much for helping out
回答1:
It's because find returns promises now
App.__container__.lookup('store:main').find('org').then(function(stuff){console.log(stuff.toArray())});
You can see that find is a promise when you do
> App.__container__.lookup('store:main').find('org').toString();
"<DS.PromiseArray:ember355>"
来源:https://stackoverflow.com/questions/18752160/how-to-debug-ember-datas-find-in-the-console