angularjs ng-hide directive

angularjs example

Hide part of the checkbox:

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

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.


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

Use as css class:


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!