AngularJS ng-disabled
지시문
예시
입력 필드 비활성화/활성화:
Disable form fields: <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>
정의 및 사용
지시문 은 ng-disabled
양식 필드(입력, 선택 또는 텍스트 영역)의 비활성화된 속성을 설정합니다.
ng-disabled
속성 내부의 표현식이 true를 반환하면 양식 필드가 비활성화됩니다 .
와 ng-disabled
사이에서 값을 이동할 수 있으려면 지시문이 필요 합니다 . HTML에서는 속성을 로 설정할 수 없습니다 (disabled 속성이 있으면 값에 관계없이 요소가 비활성화됨).true
false
disabled
false
통사론
<input ng-disabled="expression"></input>
<input>, <select> 및 <textarea> 요소에서 지원됩니다.
매개변수 값
Value | Description |
---|---|
expression | An expression that will set the element's disabled attribute if it returns true. |