Reputation: 30248
When i click on the black background , the dialog get closed , but i didn't want it to get closed ..
Here is the code :
var disconnectedDialog = $dialog.dialog({ backdrop: 'static', keyboard:false });
What option i add in this that dialog doesn't get closed ..
Please tell what to do ...... Please tell what to do ......
Please tell what to do ......
Upvotes: 1
Views: 3011
Reputation: 996
It appears you have the correct option already set. When you are setting up your modal there is an option called backdrop that allows you to either show or hide the backdrop. However according to the documentation there is another option 'static':
backdrop - controls presence of a backdrop. Allowed values: true (default), false (no backdrop), 'static' - backdrop is present but modal window is not closed when clicking outside of the modal window.
An example would be:
var modalInstance = $modal.open({
templateUrl: 'myModalContent.html',
backdrop: 'static',
controller: ModalInstanceCtrl,
resolve: {
items: function () {
return $scope.items;
}
}
});
I'm not sure what else is wrong the only suggestion may be to try the modal directive. The Angular-UI team have removed dialog as of the current version.
Upvotes: 7