form.html
1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title></title>
<style>
.container {
width: 800px;
}
</style>
</head>
<body>
<div ng-app="esNgAntd" ng-controller="mainCtrl">
<div class="container" style="padding: 50px">
<es-form name="basic" on-finish="onFinish(values)" form="form">
<es-form-item label="username" name="username">
<es-input></es-input>
</es-form-item>
<es-form-item label="area" name="area">
<es-select>
<es-select-option value="aaa">AAA</es-select-option>
<es-select-option value="bbb">BBB</es-select-option>
</es-select>
</es-form-item>
<es-form-item>
<es-button type="primary" html-type="submit">Submit</es-button>
<es-button type="primary" html-type="button" ng-click="onReset()">Reset</es-button>
</es-form-item>
</es-form>
<!-- <es-form label-col="{span:10}" wrapper-col="{span:14}">
<es-form-item label="username">
<es-input></es-input>
</es-form-item>
<es-form-item label="password">
<es-input></es-input>
</es-form-item>
</es-form> -->
</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.form = null;
$scope.onFinish = function (values) {
console.log(values)
};
$scope.onReset = function() {
$scope.form.resetFields();
}
});
</script>
</body>
</html>