-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathangular.html
More file actions
37 lines (31 loc) · 885 Bytes
/
Copy pathangular.html
File metadata and controls
37 lines (31 loc) · 885 Bytes
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
<!DOCTYPE html>
<html>
<script src= "http://apps.bdimg.com/libs/angular.js/1.3.9/angular.min.js"></script>
<body>
<p>尝试修改以下表单。</p>
<form ng-app="myApp" ng-controller="myCtrl"
name="myForm" novalidate>
名: <input type="text" name="name" ng-model="firstName" required>
<span style="color:red" ng-show="myForm.name.$dirty&& myForm.name.$invalid">*</span><br>
姓: <input type="text" ng-model="lastName"><br>
<br>
姓名: {{firstName + " " + lastName|lowercase }}<br>
<br>
单价:<input type="text" ng-model="price"><br>
<ul>
<li ng-repeat="i in list |orderBy:i |filter:price">
score:{{i|currency }}
</li>
</ul>
</form>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.firstName= "John";
$scope.lastName= "Dode";
$scope.price= 1;
$scope.list=[15,2,8,6,10,14];
});
</script>
</body>
</html>