forked from pepesan/angularjs001
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata-binding.html
66 lines (57 loc) · 1.46 KB
/
data-binding.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="js/angular.js">
</script>
<script src="js/angular-sanitize.js">
</script>
</head>
<body >
<div class="app" ng-app="app">
<div ng-controller="ctrlSizing">
<label>Width: <input ng-model="width" type="number" placeholder="How about 300?"></label>
<label>Height: <input ng-model="height" type="number" placeholder="For example: 200"></label>
<div class="box" style="width: {{width}}px; height: {{height}}px; line-height: {{height}}px;">{{width}} x {{height}}</div>
</div>
</div>
<script>
var app=angular.module("app",[]);
app.controller("ctrlSizing", ["$scope", function ($scope) {
$scope.width = 300;
$scope.height = 300;
}]);
</script>
<style>
.app {
margin: 0 auto;
max-width: 200px;
}
input {
margin: 5px 0 15px 0;
padding: 3px 6px;
display: block;
width: 100%;
}
.box {
margin: 20px 0 0 0;
text-align: center;
background: #7edc6c;
}
/* Martin Wolf CodePen Standard */
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,700);
* {
margin: 0;
padding: 0;
@include box-sizing(border-box);
}
body {
padding: 3em 2em;
font-family: 'Open Sans', Arial, sans-serif;
font-size: 1em;
line-height: 1;
}
</style>
</body>
</html>