解决方案 »

  1.   

    把test函数去掉,或者在Controller中书写test函数,里面设置$scope.selected=true/false/exp
      

  2.   

    view:
    <div ng-controller='TestCtrl'>
    <input type="checkbox"   ng-click="test()"  ng-checked="{{result}}" >{{result}}
    </div>controller:
    function TestCtrl($scope) {
          $scope.result = true;
            $scope.test = function(){
                 $scope.result = !$scope.result;
        }
               
        }
    }
    这样写就可以