-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo43.html
70 lines (66 loc) · 1.49 KB
/
demo43.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
<!DOCTYPE html>
<html ng-app="app">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>ng-class demo</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="" rel="stylesheet">
<style type="text/css">
.info{
background: #0f0;
}
.danger{
background: #f00;
}
.a{
color: #f00
}
.b{
color: #000
}
.c{
color: #0f0
}
.border{
border:1px solid #f00;
}
.danger{
background: #0f0;
}
.success{
background: #f00;
}
</style>
</head>
<body ng-controller="myCtrl">
<!-- 数组样式 -->
<!-- <input type="text" value="1" ng-model="aa" />
<input type="text" value="2" ng-model="bb" />
<div ng-class="[aa, bb]" ng-repeat="a in as">{{a.html}}</div> -->
<!-- 单行双行样式 -->
<!-- <div ng-class="{'info':$even, 'danger':$odd}" ng-repeat="a in as">{{a.html}}</div> -->
<!-- 评估表达式 -->
<input type="text" ng-model="danger" />
<input type="text" ng-model="wrong" />
<span ng-click="{'danger':danger, 'success':wrong}">11111111</span>
<script type="text/javascript" src="js/angular.min.js"></script>
<script type="text/javascript">
var app = angular.module("app",[]);
app.controller("myCtrl",function($scope){
$scope.as = [
{
"html":"a"
},{
"html":"b"
},{
"html":"c"
},{
"html":"d"
}
]
});
</script>
</body>
</html>