AngularJS ng-pasteDirective

AngularJS 参考手册AngularJS Reference Manual


AngularJS Example

Execute expression when text is pasted:

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

Try it Yourself »

Definition and Usage

ng-pasteThe directive tells AngularJS what operation to perform when text is pasted on an HTML element.

ng-pasteThe directive does not override the element's native onpaste event; when the event is triggered,ng-pasteboth the expression and the native onpaste event will be executed.


Syntax

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

This directive is supported by <input>, <select>, <textarea> and other editable elements.


Parameter Values

Value Description
expression The expression to execute when text is pasted onto the element.

AngularJS 参考手册AngularJS Reference Manual

Other Extensions