-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path07-HTML_DOM.html
More file actions
75 lines (63 loc) · 2.41 KB
/
07-HTML_DOM.html
File metadata and controls
75 lines (63 loc) · 2.41 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>AngularJS - HTML DOM</title>
<script src="js/lib/angular.min.js"></script>
</head>
<body ng-app="">
<div>
<h3>AngularJS - HTML DOM</h3>
<p>Following directives can be used to bind application data to attributes of HTML DOM Elements.</p>
</div>
<table>
<tbody>
<tr>
<th width="11%">Sr.No.</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td>1</td>
<td>ng-disabled</td>
<td>disables a given control.</td>
</tr>
<tr>
<td>2</td>
<td>ng-show</td>
<td>shows a given control.</td>
</tr>
<tr>
<td>3</td>
<td>ng-hide</td>
<td>hides a given control.</td>
</tr>
<tr>
<td>4</td>
<td>ng-click</td>
<td>represents a AngularJS click event.</td>
</tr>
</tbody>
</table>
<h3>ng-disabled directive</h3>
<p>Add ng-disabled attribute to a HTML button and pass it a model. Bind the model to an checkbox and see the variation.</p>
<input type="checkbox" ng-model="enableDisableButton">Disable Button
<button ng-disabled="enableDisableButton">Click Me!</button>
<h3>ng-show directive</h3>
<p>Add ng-show attribute to a HTML button and pass it a model. Bind the model to an checkbox and see the variation.</p>
<input type="checkbox" ng-model="showHide1">Show Button
<button ng-show="showHide1">Click Me!</button>
<h3>ng-hide directive</h3>
<p>Add ng-hide attribute to a HTML button and pass it a model. Bind the model to an checkbox and see the variation.</p>
<input type="checkbox" ng-model="showHide2">Hide Button
<button ng-hide="showHide2">Click Me!</button>
<h3>ng-click directive</h3>
<p>Add ng-click attribute to a HTML button and update a model. Bind the model to html and see the variation.</p>
<p>Total click: {{ clickCounter }}</p>
<button ng-click="clickCounter = clickCounter + 1">Click Me!</button>
</body>
</html>