I used AngularJS v1.5.3 and vendor.bundle.js and app.bundle.js
in this click to display the button and display the swal confirmation window, and I clicked "Yes, display it!" and the div is not displayed, but I click the second time and then show this div, I mean the value of $ scope.displayDiv changes, but no first-time effects please give me a solution
Here I insert my code:
<div class="input-group" ng-show="displayDiv" >
DOM data
</div>
<button class="" ng-click="disDiv()">Show</button>
$scope.displayDiv=0;
$scope.disDiv = function() {
swal({
title: 'Are you sure?',
text: "You won't to display",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, display it!',
cancelButtonText: 'No, cancel!',
confirmButtonClass: 'btn btn-success',
cancelButtonClass: 'btn btn-danger',
buttonsStyling: false
}).then(function() {
$scope.displayDiv=1;
});
};
source
share