AngularJS ng-hide 指令
AngularJS 教程
· 2019-04-01 17:19:46
AngularJS 实例
在复选框选中时隐藏一部分:
隐藏 HTML: <input type="checkbox" ng-model="myVar">
<div ng-hide="myVar">
<h1>Welcome</h1>
<p>Welcome to my home.</p>
</div>
<div ng-hide="myVar">
<h1>Welcome</h1>
<p>Welcome to my home.</p>
</div>
定义和用法
ng-hide 指令在表达式为 true 时隐藏 HTML 元素。
ng-hide 是 AngularJS 的预定义类,设置元素的 display 为 none。
语法
<element ng-hide="expression"></element>
作为 CSS 类使用:
<element class="ng-hide"></element>
所有的 HTML 元素都支持该指令。
参数值
| 值 | 描述 |
|---|---|
| expression | 表达式如果返回 true 则隐藏元素。 |
点击查看所有 AngularJS 教程 文章: https://www.codercto.com/courses/l/36.html
The Art of Computer Programming, Volumes 1-3 Boxed Set
Donald E. Knuth / Addison-Wesley Professional / 1998-10-15 / USD 199.99
This multivolume work is widely recognized as the definitive description of classical computer science. The first three volumes have for decades been an invaluable resource in programming theory and p......一起来看看 《The Art of Computer Programming, Volumes 1-3 Boxed Set》 这本书的介绍吧!