AngularJS ng-show Directive | Angular2 ngshow | AngularJs show hide | Angular2 ng show hide
Example
Show a section when a 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>
Show HTML: <input type="checkbox" ng-model="myVar">
<div ng-show="myVar">
<h1>Welcome</h1>
<p>Welcome to my home.</p>
</div>
<div ng-show="myVar">
<h1>Welcome</h1>
<p>Welcome to my home.</p>
</div>
Definition and Usage
The ng-show
directive shows the specified HTML element if the expression evaluates to true, otherwise the HTML element is hidden.
ng-show
directive shows the specified HTML element if the expression evaluates to true, otherwise the HTML element is hidden.Syntax
<element ng-show="expression"></element>Supported by all HTML elements.
<element ng-show="expression"></element>
Parameter Values
Value Description expression An expression that will show the element only if the expression returns true.
Value | Description |
---|---|
expression | An expression that will show the element only if the expression returns true. |
0 comments:
Post a Comment