checkbox.html 1.01 KB
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title></title>
    <style>
        h2 {
            margin-top: 10px !important;
        }
    </style>
  </head>

  <body>
    <div ng-app="esNgAntd" ng-controller="mainCtrl">
      <div class="container" style="padding: 50px">
        <h2>选中</h2>
        <antd-checkbox checked="checked">Checkbox</antd-checkbox>
        <h2>禁用</h2>
        <antd-checkbox disabled="true">Checkbox</antd-checkbox>
        <h2>函数回调</h2>
        <antd-checkbox on-change="handleChange(event)">Checkbox</antd-checkbox>
      </div>
    </div>
    <script src="https://cdn.staticfile.org/angular.js/1.2.28/angular.min.js"></script>
    <script src="../dist/ng-antd.js"></script>
    <script>
      angular
        .module("esNgAntd")
        .controller("mainCtrl", function ($scope, $timeout) {
          $scope.handleChange = (event)=>{
            console.log(event.target.checked)
          }

          $scope.checked = true;
        });
    </script>
  </body>
</html>