[英]ember calling super inside async callback
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()
在异步引导回调中调用超级方法失败。 检查对象的__nextSuper会产生“ undefined ”。 我正在使用余烬1.7.0.beta.4 。 我在这里想念什么?
Ember当前不支持以异步方式调用_super
:
https://github.com/emberjs/ember.js/issues/4632
我们希望更好地支持该用例。 不幸的是,实现可靠的_super
功能是一个棘手的平衡行为。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.