AngularJSng-showディレクティブ


チェックボックスがオンになっているときにセクションを表示します。

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

定義と使用法

式がtrueと評価された場合、ng-showディレクティブは指定されたHTML要素を表示します。それ以外の場合、HTML要素は非表示になります。


構文

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

すべてのHTML要素でサポートされています。


パラメータ値

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