-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
103 lines (94 loc) · 3.77 KB
/
index.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<script src="js/myApp.js"></script>
<script src="js/myCtrl.js"></script>
<style>
div{
-webkit-border-radius: 28;
-moz-border-radius: 28;
border-radius: 5px;
border: solid #1f628d 2px;
}
.green{
-webkit-border-radius: 28;
-moz-border-radius: 28;
border-radius: 5px;
border: solid #437733 2px;
}
</style>
</head>
<body>
<!-- No pueden haber dos ng-app -->
<div ng-app="myApp">
<div data-ng-init="pag='2'">
<input type="text" data-ng-model="pag">
<a href="index{{pag}}.html">Go to : {{ pag }}</a>
</div>
<div>
<p>Name: <input type="text" ng-model="name"></p>
<p ng-bind="name"></p>
</div>
<div ng-init="firstName='Jhon'">
<p>The Name is: <span ng-bind="firstName"></span></p>
</div>
<div data-ng-init="message1='alternativity you can use data-ng-* '">
<p><span data-ng-bind="message1"></span></p>
</div>
<div>
<p>My First Expression: {{ 5 + 5 }}</p>
</div>
<div data-ng-init="title='Bind using Expression {{ }} = data-ng-bind'">
<p><span>{{ title }}</span></p>
<p><input type="text" data-ng-model="expression"></p>
<p><span>{{ expression }}</span></p>
</div>
<div class="green" data-ng-controller="myCtrl">
<p>First Name: <input type="text" data-ng-model="firstName2"></p>
<p>Last Name: <input type="text" data-ng-model="lastName2"></p>
<p>Full Name: <span>{{ firstName2 + " " + lastName2 }}</span></p>
</div>
<div data-ng-init="myCol='ff00f0'" style="background-color:{{myCol}};" >
<input type="color" data-ng-model="myCol" style="display:inline-block;">
<h3 style="display:inline-block;">{{myCol}}</h3>
</div>
<div data-ng-init="quantity='2';cost='5'">
<p>Total In Dollar: <span data-ng-bind="quantity * cost"></span></p>
</div>
<div data-ng-init="message='Object in Angular Js';
person=[
{firstName:'Jean',lastName:'Trujillo',country:'Venezuela'},
{firstName:'Carlos',lastName:'Contreras',country:'Chile'}]">
<p>Looping with objects:</p>
<p>person [ </p>
<ul>
<li data-ng-repeat="y in person">{{ 'firstName: '+y.firstName+', lastName: '+y.lastName+', country: '+y.country }}</li>
</ul>
<p>]</p>
</div>
<div data-ng-init="points=['Cero','unoArray','dosArray','TresArray','CuatroArray']" style="display:inline-block">
<p><span>points=['Cero','unoArray','dosArray','TresArray','CuatroArray']</span></p>
<p>Lenght of Array: 5 </p>
<p><input type="text" data-ng-model="number" maxlength="1"></p>
<p>Value [ {{number}} ] : <span data-ng-bind="points[number]"></span></p>
</div>
<div style="display:inline-block">
<p><span>data-ng-repeat : directive to repeat</span></p>
<ul>
<li data-ng-repeat="x in points">
{{ x }}
</li>
</ul>
</div>
<div my-new-directive>
<p> </p>
</div>
</div>
<!-- directive: my-new-directive -->
</body>
</html>