Angular js取消选中取消按钮单击复选框

时间:2017-06-23 22:16:37

标签: javascript html angularjs

<input type="checkbox" name="chk" ng-model="Crate" ng-click="crate('sm',$event)">
模型取消

$scope.cancelC = function() {
console.log($scope.Crate); 
}

//显示错误但未取消选中复选框

1 个答案:

答案 0 :(得分:0)

您必须指定ng值。您只能使用(env)somesone@somewhere:/$ df -iT Filesystem Type Inodes IUsed IFree IUse% Mounted on /dev/root ext4 25149440 612277 24537163 3% / devtmpfs devtmpfs 3085602 1418 3084184 1% /dev none tmpfs 3086068 2 3086066 1% /sys/fs/cgroup none tmpfs 3086068 858 3085210 1% /run none tmpfs 3086068 1 3086067 1% /run/lock none tmpfs 3086068 1 3086067 1% /run/shm none tmpfs 3086068 4 3086064 1% /run/user 或其他值作为字符串值ng-value="true"

ng-value="'now-this-is-a-string-value'"
angular.module('test', []).controller('TestController', function() {
  var vm = this;
  this.title = 'Test';
  this.value = true;
  this.toggle = function() {
    vm.value = !vm.value;
  };
});