2013-05-09 126 views
1

我正在关注由Brian Cadarella在DockYard上的一个教程。 使用Rails-api后端构建Ember应用程序。 http://reefpoints.dockyard.com/ember/2013/01/09/building-an-ember-app-with-rails-api-part-2.htmlEmber路线模型问题

只要我改变:

App.UsersIndexRoute = Ember.Route.extend 
    setupController: (controller, model) -> 
    controller.set('users', model) 
    @controllerFor('application').set('currentRoute', 'users') 

要:

App.UsersIndexRoute = Ember.Route.extend 
    model: -> 
    App.User.find() 
    setupController: (controller, model) -> 
    controller.set('users', model) 
    @controllerFor('application').set('currentRoute', 'users') 

我的用户页面链接不起作用。我碰到下面的错误在我的萤火控制台:

TypeError: Ember.RSVP.reject is not a function 
[Break On This Error] 
return Ember.RSVP.reject(error); 

Ember.RSVP.reject是灰烬,data.js

为什么不工作?我一直遵循这个教程。

+0

我的其他答案也许是对你的帮助http://stackoverflow.com/questions/16368964/emberjs-typeerror-object-object-has-no-method-reject/16369039#16369039我敢肯定,如果你更新你的依赖一切都会起作用。 – intuitivepixel 2013-05-09 15:40:09

+0

是Ee Aye Utiful。现在正在工作,谢谢。 – collinglass 2013-05-09 19:24:56

+0

不客气,你可以upvote我的答案,如果它是有用的:) – intuitivepixel 2013-05-09 19:27:55

回答