需要在模式區域之外的半透明背景。我得到的帽子是不透明的白色區域。背景設置背景:虛假工作。
var confirmInstance = $uibModal.open({
animation: true,
ariaLabelledBy: 'modal-title',
ariaDescribedBy: 'modal-body',
templateUrl: 'abc.html',
size: 'sm',
backdrop: false,
controller:function($uibModalInstance){
this.cancel = function() {
$uibModalInstance.dismiss('cancel');
};
this.ok=function(){
}
},
controllerAs:'$ctrl',
resolve: {
items: function() {
console.log("In resolve");
}
}
});
下面是模式的我的HTML代碼:
<div><h1>Welcome here.. doing some more displaying stuff</h1></div>
<script type="text/ng-template" id="abc.html">
<div class="modal-header">
Remove {{$ctrl.type}}
<button type="button" class="close" data-dismiss="modal" ng-click="$ctrl.cancel()">×</button>
</div>
<div class="modal-body" id="modal-body">
<p>Confirm request for removal of {{$ctrl.type}} {{$ctrl.name}}?</p>
</div>
<div class="modal-footer">
<button class="btn-revoke" type="button" ng-click="$ctrl.ok()">Ok</button>
<button class="btn-cancel" type="button" ng-click="$ctrl.cancel()">Cancel</button>
</div>
</script>
在演示網站中正常工作,因此創建了一個重現問題的重陷。見[mcve] – charlietfl
是的,同樣的例子在plunker中工作正常。那麼爲什麼不在這裏。 – FalconFlyer
你必須有不同的css或css衝突。需要檢查適用於您的瀏覽器中的重疊規則的工具elemetns inspector – charlietfl