我有一个Ember 1.13应用程序,我想列出与其他用户匹配的所有用户。我有http://localhost:3000/api/v1/users/1/matches
返回
{"users":[{"id":1,"email":"test@test.com","nickname":"Test","bio":"test","created_at":"2015-06-28T16:03:52.423Z","updated_at":"2015-06-28T16:03:52.423Z","encrypted_password":"$2a$10$RPJmVJNfFvjwzIG0wfC6yONRz20WBogUw35ibz2Hv.M6TC/M7FZ8e","confirmation_token":null,"remember_token":"fb5653e22ad30d3ad3a90ab0b028bd7348cd71a1"}]}
如the doc所示,我有这条路线:
export default Ember.Route.extend
model: ->
Ember.$.getJSON('http://localhost:3000/api/v1/users/1/matches')
这个模板:
{{#each model as |user|}}
user
{{/each}}
我应该在模板中看到user
,但我什么都没有。我错过了什么吗?
答案 0 :(得分:0)
{{#each model.users as |user|}}
user
{{/each}}