IE9:store.find承诺未解决

时间:2014-01-08 16:58:32

标签: ember.js ember-data

我有类似下面的代码(coffeescript):

Ember.Application.initializer
  name: 'currentPerson'
  initialize: (container, application) ->
    application.deferReadiness()
    store.find('person', 'current')
    .then (person) ->
      #Never executed
      application.advanceReadiness()
    .fail >
      #Never executed
      application.advanceReadiness()

这适用于所有其他浏览器,但不适用于IE9。

有趣的是,如果我调试它,并在findById创建promise(findById由store.find调用)之后放置断点,它就可以工作。所以它似乎是某种数据竞争。有没有人经历过这个?

1 个答案:

答案 0 :(得分:0)

令我惊讶的是,它适用于所有其他浏览器,因为我认为您必须使用胖箭头(=>)来访问application,此外您永远不会调用advanceReadiness (需要())。

如果在任何then / fail方法中发生错误,它将以静默方式失败。要捕获这些错误,请参阅https://github.com/tildeio/rsvp.js#error-handling