沒有爲使用與Ember使用組件對話框官方食譜: http://emberjs.com/guides/cookbook/user_interface_and_interaction/using_modal_dialogs/如何簡單地將引導程序2模式對話框包裝在一個ember組件中?
我希望做的是使用Twitter的引導2個對話框來代替。
它可以工作,closeModal操作除外。
我需要註冊回調引導事件「隱藏」,調用關閉操作,但我的嘗試不成功。
App.ModalDialogComponent = Ember.Component.extend({
didInsertElement: function() {
this.$('.modal').modal('show');
this.$('.modal').on("hidden", function() {
// how to trigger the close action from here ?
});
},
actions: {
close: function() {
return this.sendAction();
}
}
});
這裏是一個完整的jsfiddle: http://jsfiddle.net/NQKvy/417/
謝謝,我確信那是我第一次嘗試(self.send的調用(「親密'))!但是我必須做一些其他的事情。無論如何,我在另一個迴應中加入了我正在使用的解決方案,以供參考。如果你閱讀這個問題,一定要看看它。 –