我是角度js的新手,我需要在ng-if语句为false时显示模态弹出框。你能帮助我解决这个问题吗?
in html:
<div ng-if="inputdata == false" >
</div>
如果输入数据为false,我需要显示模态弹出窗口。
答案 0 :(得分:1)
试试这个:
控制器:
var myApp = angular.module('myApp', []);
myApp.controller('myCtrl', function($scope) {
$scope.inputdata = true;
});
查看:
<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>
风格:
.popup{padding:10px;display:block;position:absolute;top:0;left:0;height:30px;width:200px;background:#efefef;}