AngularJS ng-disabled指令
AngularJS 实例
入力ボックスの無効化または有効化:
禁用表单输入域:<input type="checkbox" ng-model="all">
<br>
<input type="text" ng-disabled="all">
<input type="radio" ng-disabled="all">
<select ng-disabled="all">
<option>Female</option>
<option>Male</option>
</select>
<br>
<input type="text" ng-disabled="all">
<input type="radio" ng-disabled="all">
<select ng-disabled="all">
<option>Female</option>
<option>Male</option>
</select>
尝试一下 »
定義と用法
ng-disabledディレクティブはフォーム入力フィールド(input、select、または textarea)の disabled 属性を設定します。
如果ng-disabled中の式が true を返す場合、フォームフィールドは無効になります。
语法
<input ng-disabled="expression"></input>
<input>、<select>、および <textarea> 要素はすべてこのディレクティブをサポートします。
参数值
| 值 | 描述 |
|---|---|
| expression | 式が true を返す場合、要素に disabled 属性を追加するように設定されます。 |
其他扩展