Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

AngularJS ng-show Directive

AngularJS ng-show Instruction

AngularJS Reference Manual AngularJS Reference Manual


AngularJS Examples

Show a section when the checkbox is checked:

Show HTML:

<

input

type=

"checkbox"

ng-model=

"myVar"

<

div

ng-show=

"myVar"

<

h1

Welcome

<

/h1

<

p

Welcome to my home.

<

/p

<

/div

Try it »


Definition and Usage

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


Syntax

<

element

ng-show=

"expression"

<

/element

All HTML elements support this directive.


Parameter value

Value Description
expression If the expression is true, the specified HTML element is shown.

AngularJS Reference Manual AngularJS Reference Manual