<body>
<div ng-app="myApp" ng-controller="myCtrl">
<ul>
<li ng-repeat="x in items">
<input type="checkbox" value="{{ x.value }}" /> {{ x.name }}
<li>
</ul>
</div>
</body>
<script>
angular.module('myApp', []).controller('myCtrl', function($scope) {
$scope.items = [
{name: 'Dog', value: 'dog'},
{name: 'Pig', value: 'pig'},
{name: 'Cat', value: 'cat'},
{name: 'Duck', value: 'duck'},
{name: 'Bird', value: 'bird'}
];
});
</script>
添加回答
举报
0/150
提交
取消