我用ng-repeat生成一组checkbox,并给checkbox添加点击事件,修改button中ng-hide中的值,为什么不能改变button显示隐藏的状态?我要做到点击事件来控制button的显示隐藏该怎么实现?
<html>
<head>
<meta charset="utf-8">
<script src="http://www.hubwiz.com/scripts/angular.min.js"></script>
<script type="text/javascript">
angular.module('myModel',[])
.controller('myctrl',['$scope',
function($scope){
$scope.falg = false,
$scope.showButton = function(){
if($scope.falg == false ){
$scope.falg = true;
}else{
$scope.falg = false ;
}
}
}]);
</script>
</head>
<body ng-app="myModel">
<div ng-controller="myctrl" ng-init="s = true" >
<input type="checkbox" ng-click="showButton()" ng-repeat="x in [1,2,3,4,5]">
<button ng-hide="{{falg}}">修改</button>
</div>
</body>
</html>