Angular随手记之html dom

1. ng-disabled

 <div ng-app="" ng-init="mySwitch=true">

<p>
<button ng-disabled="mySwitch">点我!</button>
</p>

<p>
<input type="checkbox" ng-model="mySwitch">按钮
</p>

<p>
{{ mySwitch }}
</p>

</div> 
View Code

2. ng-show

<div ng-app="" ng-init="hour=13">
 
<p ng-show="hour > 12">我是可见的。</p>
 
</div>
View Code

3. ng-hide

 <div ng-app="">

<p ng-hide="true">我是不可见的。</p>

<p ng-hide="false">我是可见的。</p>

</div> 
View Code

 

posted @ 2018-01-11 11:07  YanyuWu  阅读(76)  评论(0)    收藏  举报