ล่าสุดการพัฒนาเว็บบทเรียน
 

AngularJS Directive NG-คนพิการ


ตัวอย่าง

ปิด / เปิดช่องใส่:

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 สั่งชุดคนพิการแอตทริบิวต์ของสนามแบบฟอร์ม (input เลือกหรือ textarea)

ข้อมูลแบบฟอร์มจะถูกปิดใช้งานถ้าการแสดงออกภายใน ng-disabled แอตทริบิวต์ผลตอบแทนจริง

ng-disabled สั่งเป็นสิ่งที่จำเป็นเพื่อให้สามารถที่จะเปลี่ยนค่าระหว่าง true และ false ใน html คุณไม่สามารถตั้งค่า disabled แอตทริบิวต์ false (การปรากฏตัวของแอตทริบิวต์พิการทำให้องค์ประกอบปิดการใช้งานโดยไม่คำนึงถึงว่ามันคุ้มค่า)


วากยสัมพันธ์

<input ng-disabled=" expression "></input>

สนับสนุนโดย <input>, <เลือก> และ <textarea> องค์ประกอบ


ค่าพารามิเตอร์

Value Description
expression An expression that will set the element's disabled attribute if it returns true.