button.html 1.46 KB
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" />
    <title></title>
    <style>
        h2 {
            margin-top: 16px !important;
        }
    </style>
</head>

<body>
    <div ng-app="esNgAntd" ng-controller="mainCtrl">
        <div class="container" style="padding: 50px">
            <h2>Primary</h2>
            <es-button type="primary">Primary</es-button>
            <h2>Default</h2>
            <es-button>I am button.</es-button>
            <h2>Link</h2>
            <es-button type="link" ng-click="handleClick()">Link</es-button>
            <h2>Ghost</h2>
            <es-button type="primary" ghost="ghost">Link</es-button>
            <h2>Loading</h2>
            <es-button type="primary" loading="{{loading}}" ng-click="enterLoading()">Click me</es-button>
        </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.handleClick = function() {
                    alert(123123);
                }
                $scope.loading = false;
                $scope.enterLoading = function() {
                    $scope.loading = true;
                    $timeout(function(){
                        $scope.loading = false;
                    }, 5000)
                }

            });
    </script>
</body>

</html>