Modal backgrop


#1

Hello! I have a login form in a modal window. Is there a way to prevent it from closing (well any modal) when clicking on the backdrop? I noticed that there’s an option “backdropClickToClose” but it doesn’t work:

Code:

			if (authRequired == true){
				console.log("Loading Modal...",$ionicModal);
				if(!$scope.loginLoaded)
				{
					$ionicModal.fromTemplateUrl('views/login.html', function(modal) {
					    
					$scope.loginLoaded = true;
					$scope.modal = modal;
					$scope.modal.show();
						
					 },
					 {
						    scope: $scope,
						    animation: 'slide-in-up',
						    focusFirstInput: 'true',
						    backdropClickToClose: 'false'  // doesn't work
					 });
				}
				$("#errorLoginMsg").html(response.responseJSON.errorMessage);
				console.log("Login Page Loaded");
			} 

#2

See here

http://codepen.io/mhartington/pen/zsrfg

    $ionicModal.fromTemplateUrl('modal.html', {
    scope: $scope,
    backdropClickToClose: false

    }).then(function(modal) {
    $scope.modal = modal;
    });

#3

Great! Thanks, this is very helpful!!


#4

work’s great , thanks