AngularJS HTML DOM
AngularJS 为 HTML DOM 元素的属性提供了绑定应用数据的指令。
ng-disabled 指令
ng-disabled 指令直接绑定应用程序数据到 HTML 的 disabled 属性。
AngularJS 实例
<p>
<button ng-disabled="mySwitch">点我!</button>
</p>
<p>
<input type="checkbox" ng-model="mySwitch">按钮
</p>
<p>
{{ mySwitch }}
</p>
</div>
实例讲解:
ng-disabled 指令绑定应用程序数据 "mySwitch" 到 HTML 的 disabled 属性。
ng-model 指令绑定 "mySwitch" 到 HTML input checkbox 元素的内容(value)。
如果 mySwitch 为true, 按钮将不可用:
<button disabled>点我!</button>
</p>
如果 mySwitch 为false, 按钮则可用:
<button>点我!</button>
</p>
ng-show 指令
ng-show 指令隐藏或显示一个 HTML 元素。
AngularJS 实例
<p ng-show="true">我是可见的。</p>
<p ng-show="false">我是不可见的。</p>
</div>
ng-show 指令根据 value 的值来显示(隐藏)HTML 元素。
你可以使用表达式来计算布尔值( true 或 false):
AngularJS 实例
| 在下一个章节中,我们将为大家介绍更多通过点击按钮来隐藏 HTML 元素的实例。 |
ng-hide 指令
ng-hide 指令用于隐藏或显示 HTML 元素。
AngularJS 实例
<p ng-hide="true">我是不可见的。</p>
<p ng-hide="false">我是可见的。</p>
</div>
点击查看所有 AngularJS 教程 文章: https://codercto.com/courses/l/36.html
Learn Python 3 the Hard Way
Zed A. Shaw / Addison / 2017-7-7 / USD 30.74
You Will Learn Python 3! Zed Shaw has perfected the world’s best system for learning Python 3. Follow it and you will succeed—just like the millions of beginners Zed has taught to date! You bring t......一起来看看 《Learn Python 3 the Hard Way》 这本书的介绍吧!
RGB转16进制工具
RGB HEX 互转工具
随机密码生成器
多种字符组合密码