这里我使用Angular和Bootstrap,当我点击*图标或点击关闭按钮为什么模态不隐藏
<div class="modal" id="modalSuccess">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<button class="close" data-toggle="modal" data-target="#modalSuccess">×</button>
<h4 style="color:green">{{msg}}</h4>
</div>
<div class="modal-footer">
<input type="button" class="btn btn-success btn-sm" value="Close" ng-click="okCloseBtn()" />
</div>
</div>
</div>
</div>
Angular.Js
$scope.okCloseBtn = function () {
alert('in closer')
$('#modalSuccess').modal('hide');
}
这里提醒工作请在我做错的地方给我答案
答案 0 :(得分:1)
您需要使用$modalInstance
$scope.okCloseBtn = function () {
$modalInstance.dismiss('cancel');
};