[英]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.