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

AngularJS ng-Show instruction

AngularJS Reference Manual

Display HTML

<!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="">
Display HTML: <input type="checkbox" ng-model="myVar">
<div ng-show="myVar">
<h1>Welcome</h1>
<p>Welcome to my home.</p>
</div>
</body>
</html>
Test and see ‹/›

Definition and Usage

ng-show The directive displays the specified HTML element when the expression is true, and hides the specified HTML element otherwise.

Syntax

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

All HTML elements support this directive.

Parameter Value

ValueDescription
expressionDisplay the specified HTML element if the expression is true.

AngularJS Reference Manual