form.html
2.17 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
63
64
65
<!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">
<antd-form name="basic" on-finish="onFinish(values)" form="form">
<antd-form-item label="username" name="username">
<antd-input></antd-input>
</antd-form-item>
<antd-form-item label="area" name="area">
<antd-select>
<antd-select-option value="aaa">AAA</antd-select-option>
<antd-select-option value="bbb">BBB</antd-select-option>
</antd-select>
</antd-form-item>
<antd-form-item label="area" name="checkbox">
<antd-checkbox>Checkbox</antd-checkbox>
</antd-form-item>
<antd-form-item>
<antd-button type="primary" html-type="submit">Submit</antd-button>
<antd-button type="primary" html-type="button" ng-click="onReset()">Reset</antd-button>
</antd-form-item>
</antd-form>
<!-- <antd-form label-col="{span:10}" wrapper-col="{span:14}">
<antd-form-item label="username">
<antd-input></antd-input>
</antd-form-item>
<antd-form-item label="password">
<antd-input></antd-input>
</antd-form-item>
</antd-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>