Tuesday, April 21, 2015

AngularJs show hide toggle on checkbox click

<html>
<title> AngularJs Directives </title>
<head>
<title>Angular JS Table</title>
<style>
table, th , td {
border: 1px solid grey;
border-collapse: collapse;
padding: 5px;
}
table tr:nth-child(odd) {
background-color: #f2f2f2;
}
table tr:nth-child(even) {
background-color: #ffffff;
}
</style>
</head>
<body>

<div ng-app="">

<table>
<tr>

<td>
<input type="checkbox" ng-model="showHide1">Disable Button
</td>

<td>
<button ng-show="showHide1">Show</button>
</td>

<td>
<button ng-hide="showHide1">Hide</button>
</td>
</tr>

</table>


</div>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>



</body>
</html>

No comments:

Post a Comment