Modal backgrop

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");
			} 

See here

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

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

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

Great! Thanks, this is very helpful!!

work’s great , thanks