Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

AngularJS ng-paste Directive

AngularJS ng-paste Instruction

AngularJS Reference Manual AngularJS Reference Manual


AngularJS Examples

Execute an expression when text is pasted:

<

input

ng-paste=

"count = count + 1"

ng-init=

"count=0"

value=

"Paste text here"

/

Try it »


Definition and Usage

ng-paste The directive tells AngularJS the action to take when text is pasted onto an HTML element.

ng-paste The directive does not override the element's native onpaste event. When the event is triggered,ng-paste both the expression and the native onpaste event will be executed.


Syntax

<

element

ng-paste=

"expression"

<

/element

,


Parameter value

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

AngularJS Reference Manual AngularJS Reference Manual