http://zhidao.baidu.com/question/711789323013167565
<!DOCTYPE html>
<
html
ng-app
=
"test"
>
<
head
>
<
title
>angularJs-checkbox</
title
>
</
head
>
<
body
>
<
div
ng-controller
=
"CheckCtrl"
>
<
input
type
=
"checkbox"
ng-model
=
"chk"
ng-click
=
"check(chk)"
/>
</
div
>
<
script
type
=
"text/javascript"
src
=
"../js/angular.min.js"
></
script
>
<
script
type
=
"text/javascript"
>
//直接判断checkbox的model即可
var test = angular.module('test', []);
test.controller('CheckCtrl', function($scope){
//设置checkbox默认不选中
$scope.chk = false;
$scope.check = function(val){
!val ? alert('选中') : alert('未选中');
}
})
</
script
>
</
body
>
</
html
>