-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo01.html
71 lines (67 loc) · 1.64 KB
/
demo01.html
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
66
67
68
69
70
71
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>demo01</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="" rel="stylesheet">
<script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script>
<script>
var phonecatApp1 = angular.module('phonecatApp11', []);
// Define the `PhoneListController` controller on the `phonecatApp` module
phonecatApp1.controller('PhoneListController', function PhoneListController($scope) {
$scope.phones = [
{
name: 'Nexus S',
snippet: 'Fast just got faster with Nexus S.'
}, {
name: 'Motorola XOOM™ with Wi-Fi',
snippet: 'The Next, Next Generation tablet.'
}, {
name: 'MOTOROLA XOOM™',
snippet: 'The Next, Next Generation tablet.'
}
];
$scope.num = 1;
$scope.price = 1;
}
);
</script>
</head>
<body ng-app="phonecatApp11" ng-controller="PhoneListController">
<div>
<p>数量:<input type="number" ng-model="num"></p>
<p>价格:<input type="number" ng-model="price"></p>
<h2>HELLO {{num * price}}</h2>
<h2>总价:<span ng-bind="num * price"></span></h2>
</div>
<p>1 + 2 = {{1 + 2}}</p>
<div>
<div>
<input type="text" ng-model="name">
<h2>{{'用户名:' + name }}</h2>
</div>
</div>
<div>
<ul>
<!-- <li>
<span>Nexus S</span>
<p>
Fast just got faster with Nexus S.
</p>
</li>
<li>
<span>Motorola XOOM™ with Wi-Fi</span>
<p>
The Next, Next Generation tablet.
</p>
</li> -->
<li ng-repeat="phone in phones">
<span>{{phone.name}}</span>
</li>
</ul>
</div>
</body>
</html>