-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtester2.html
67 lines (61 loc) · 1.75 KB
/
tester2.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
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Test</title>
<script src="../bower_components/jquery/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../bower_components/angular/angular.js" type="text/javascript" charset="utf-8"></script>
<script src="ng-responsive.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
angular.module("test", ["ngResponsive"])
.config(function($responsiveProvider) {
$responsiveProvider.setBreakpoints({
mobile: "0px-400px",
tablet: "400px-600px",
retina: "600px-1200px",
desktop: "1200px-max"
});
})
.controller("testController", function($responsive, $scope) {
$responsive.retina(function() {
$scope.flag = null
$scope.items = ["iphone5"]
});
$responsive.mobile(function() {
$scope.flag = null
$scope.items = ["iphone", "galaxy", "droid"]
});
$responsive.tablet(function() {
$scope.items = ["ipad", "nexus"]
});
$responsive.desktop(function() {
$scope.items = ["pc", "mac"]
});
$responsive.tablet().desktop(function() {
$scope.flag = "tablet and desktop";
});
});
</script>
<style type="text/css" media="all">
#colorbox {
width: 200px;
height: 200px;
}
#colorbox {
text-align: center;
color: #fff;
font: 30px Helvetica;
padding-top: 85px;
}
</style>
</head>
<body>
<div ng-app="test">
<div ng-controller="testController">
<h1>{{flag}}</h1>
<ul>
<li ng-repeat="item in items">{{item}}</li>
</ul>
</div>
</div>
</body>
</html>