码迷,mamicode.com
首页 > Web开发 > 详细

angularJs中的checkboxs

时间:2017-06-09 00:51:25      阅读:245      评论:0      收藏:0      [点我收藏+]

标签:model   ctr   value   checkbox   als   ==   angular   ide   control   

<!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

标签:model   ctr   value   checkbox   als   ==   angular   ide   control   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!