input.html 2.16 KB
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" />
    <title></title>
    <link href="https://cdn.staticfile.org/antd/3.26.9/antd.css" rel="stylesheet" />
    <style>
        div.row {
            margin-bottom: 16px;
        }
    </style>
</head>

<body>
    <div ng-app="esNgAntd" ng-controller="mainCtrl">
        <div class="container" style="padding: 50px">
            <div class="row">
                    <antd-input max-length="3"></antd-input>
            </div>
            <div class="row">
                <antd-input-group compact="true">
                    <antd-input style="width: 50px"></antd-input><antd-input style="width: 50px"></antd-input>
                </antd-input-group>
            </div>
            <div class="row">
                <antd-input-group compact="true">
                    <antd-input style="width: 50px" addon-before="长"></antd-input><antd-input style="width: 50px" addon-before="长"></antd-input>
                </antd-input-group>
            </div>
            <div class="row">
                <antd-input on-change="handleChange(event)" value="{{value}}"></antd-input>
            </div>
            <div class="row">
                <antd-input placeholder="Basic usage" style="width: 200px"></antd-input>
            </div>
            <div class="row">
                <antd-input placeholder="Basic usage" value="abc"></antd-input>
            </div>
            <div class="row">
                <antd-input addon-before="Http://" on-change="handleChange()"></antd-input>
            </div>
            <div class="row">
                <antd-input disabled="true"></antd-input>
            </div>
        </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) {
                $scope.value = "123123";
                $scope.handleChange = function(event) {
                    console.log("input changed.", event)
                    $scope.value="4566";
                }
            });
    </script>
</body>

</html>