我正在使用AngularJS和Bootstrap的應用程序。我試圖使用Bootstrap UI顯示並隱藏我的控制器中的對話框。出於某種原因,當我嘗試打開對話框時,我只看到一個變黑的屏幕。但是,對話從不出現。使用Bootstrap UI顯示和隱藏AngularJS對話框
在這種plunker,你可以看到,我有:
var modalInstance = $modal.open({
templateUrl: 'item-dialog.html',
size: 'sm'
});
modalInstance.result.then(
function (res) {
console.log('here');
},
function (err) {
$log.info('Modal dismissed at: ' + new Date());
}
);
它看起來正確的給我。爲什麼只出現黑屏?謝謝!
感謝你的分享。但是如何從MyController關閉對話框?當我按照這個例子,當我嘗試注入'$ modalInstance'時,我得到一個模塊加載錯誤。非常感謝你分享你的知識。 – user70192 2014-09-19 13:34:42