2017-09-18 4 views
0

私はAngularJSでブートストラップモーダルを使用しますが、私の質問はモーダルの周囲をクリックしてモーダルが閉じられたときのイベントですか?AngularJS/Bootstrapモーダル - モダルが周囲をクリックして閉じる場合のイベント

ダイアログが解任または近い将来性を持つことができるので、あなたがものを行うことができますモーダルO ui.bootstrapのドキュメントで
function showMyModal() { 
    var myModal = $modal.open({ 
     controller: MyController, 
     controllerAs: 'vm', 
     size: 'lg', 
     windowClass: "modal fade in", 
     resolve: { 

     }, 
     templateUrl: 'app/myTemplate.modal.html' 
     }); 
    return myModal; 

    function MyController(... 

答えて

0

myModal.result.then(function (response) { 
    $log.info(response); 
}, function() { 
    $log.info('Modal dismissed at: ' + new Date()); 
}); 

このイベントは

$uibModalInstance.close($scope.selected.item); 

及び

$uibModalInstance.dismiss('cancel'); 
によってトリガされます
関連する問題