Home>

angularjs ng-hide directive

angularjs example

Hide part of the checkbox:

<! Doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script>
</head>
<body ng-app="">
Hide html:<input type="checkbox" ng-model="myvar">
<div ng-hide="myvar">
<h1>welcome</h1>
<p>welcome to my home.</p>
</div>
</body>
</html>

Definition and usage

The ng-hide directive hides html elements when the expression is true.

ng-hide is a predefined class of angularjs,Set the element's display to none.

grammar

<element ng-hide="expression"></element>

Use as css class:

<element></element>

All html elements support this directive.

Parameter value

value description
expression The expression hides the element if it returns true.

  • Previous AngularJs custom service implementation signing and encryption
  • Next jquery like function to implement the code like it!