ng-pasteคำสั่งAngularJS


ตัวอย่าง

ดำเนินการนิพจน์เมื่อข้อความถูกวางลงในช่องใส่:

<input ng-paste="count = count + 1" ng-init="count=0" value="Paste text here" />

ความหมายและการใช้งาน

คำng-pasteสั่งบอก AngularJS ว่าต้องทำอย่างไรเมื่อวางข้อความลงในองค์ประกอบ HTML

คำng-pasteสั่งจาก AngularJS จะไม่แทนที่เหตุการณ์ onpaste ดั้งเดิมขององค์ประกอบ ทั้งสองจะถูกดำเนินการ


ไวยากรณ์

<element ng-paste="expression"></element>

รองรับโดย <input>, <select> และ <textarea> และองค์ประกอบที่แก้ไขได้อื่นๆ


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

Value Description
expression An expression to execute when text is being pasted into an element.