首页 > Web开发 > 详细

angularJs中的checkboxs

时间:2017-06-09 00:36:10      阅读:342      评论:0      收藏:0      [点我收藏+]

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="../js/angular-1.3.0.js" ></script>
</head>
<body>
<div ng-app="hd" ng-controller="ctrl">
游戏:<input type="checkbox" ng-model="data.game" ng-true-value="1" ng-false-value="0"/>
电影:<input type="checkbox" ng-model="data.video" ng-true-value="1" ng-false-value="0"/>
{{data}}

<div ng-show="data.game == 1">游戏</div>
<div ng-show="data.video == 1">电影</div>
</div>

<script type="text/javascript">
var m = angular.module(‘hd‘,[]);
m.controller(‘ctrl‘,[‘$scope‘,function($scope){
$scope.data = {game:0,video:0}
}]);
</script>
</body>
</html>

angularJs中的checkboxs

原文:http://www.cnblogs.com/qiyc/p/6965210.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!