Tutorials References Exercises Bootcamps Videos Menu
Sign Up Create Website Get Certified Upgrade

AngularJS ng-show Directive


Show a section when a checkbox is checked:

Show HTML: <input type="checkbox" ng-model="myVar">
<div ng-show="myVar">
<p>Welcome to my home.</p>
Try it Yourself »

Definition and Usage

The ng-show directive shows the specified HTML element if the expression evaluates to true, otherwise the HTML element is hidden.


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

Supported by all HTML elements.

Parameter Values

Value Description
expression An expression that will show the element only if the expression returns true.