Reputation: 177
I am new to angular js , i need to display the modal pop up box when the ng- if statement is false . could u guys please help me in this problem ?
in html :
<div ng-if="inputdata == false" >
</div>
if the input data is false i need to show the modal popup window .
Upvotes: 1
Views: 4051
Reputation: 27242
Try this :
controller :
var myApp = angular.module('myApp', []);
myApp.controller('myCtrl', function($scope) {
$scope.inputdata = true;
});
View :
<div class="content" ng-app="myApp" ng-controller="myCtrl">
<div class="field">
<button ng-click="inputdata = false">Show Popup</button>
<div ng-show="!inputdata" class="popup">
</div>
</div>
</div>
Style :
.popup{padding:10px;display:block;position:absolute;top:0;left:0;height:30px;width:200px;background:#efefef;}
Upvotes: 1