简体   繁体   中英

Ember Route model issue

I am following a tutorial by Brian Cadarella on DockYard. Building an Ember app with Rails-api backend. http://reefpoints.dockyard.com/ember/2013/01/09/building-an-ember-app-with-rails-api-part-2.html

As soon as I change:

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

To:

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

My link to the users page does not work. I get the following error in my firebug console:

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

Ember.RSVP.reject is in ember-data.js

Why is it not working? I have been following that tutorial word for word.

我的另一个答案可能对您有帮助EmberJS TypeError:对象#<Object>没有方法'reject' …我确定如果您更新依赖项,一切都会正常。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM