如何使用AngularJS的ngShow和ngHide
发布网友
发布时间:2022-05-01 22:45
我来回答
共1个回答
热心网友
时间:2022-04-24 05:12
试试我这个例子,有不明白的再问
<!DOCTYPE html>
<html ng-app="test">
<head>
</head>
<body ng-controller="showCtrl">
<input type="checkbox" ng-model="checked"><br/>
<div ng-show="checked">hello<div>
<script type="text/javascript" src="./angular.min.js"></script>
<script>
var app = angular.mole('test', []);
app.controller('showCtrl', function($scope, $window){
//默认展示
$scope.checked = true;
});
</script>
</body>
</html>