App.LoadAfterModalMixin = Ember.Mixin.create
didInsertElement: ->
superMethod = @_super
modal = @.$().parents('.scrollable-modal')
if modal.length > 0
if modal.hasClass('in')
# if the modal is already shown, run the method as the shown event has aleady been fired
superMethod.call(this)
else
# run the method after the modal is shown
modal.on "shown.bs.modal", =>
superMethod.call(_this)
else
@_super()
在异步引导回调中调用 super 方法失败。检查对象的 __nextSuper 会产生“未定义”。我正在使用 ember 1.7.0.beta.4。我在这里缺少什么?
最佳答案
Ember 目前不支持以异步方式调用 _super
:
https://github.com/emberjs/ember.js/issues/4632
我们希望更好地支持这个用例。不幸的是,实现可靠的_super
功能是一个棘手的平衡行为。
关于javascript - ember 在异步回调中调用 super,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25420758/