English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

AngularJS ng-hide directive

AngularJS Reference Manual

!DOCTYPE html
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.staticfile.org/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>/p>
</div>
</body>
</html>
Test to see ‹/›

Definition and Usage

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

ng-hide is an AngularJS predefined class that sets the element's display for none.

Syntax

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

Used as a CSS class:

<element></element>

All HTML elements support this directive.

Parameter Value

ValueDescription
expressionHide the element if the expression returns true.

AngularJS Reference Manual