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

AngularJS ng-copy Directive

AngularJS ng-copy Instruction

AngularJS Reference Manual AngularJS Reference Manual


AngularJS Examples

Execute an expression when the text in the input field is copied:

<

input

ng-copy=

"count = count + 1"

ng-init=

"count=0"

value=

"Copy this text"

/

Try it »


Definition and Usage

ng-copy The directive tells AngularJS the action to take when the text of an HTML element is copied.

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


Syntax

<

element

ng-copy=

"expression"

<

/element

All HTML elements are supported.


Parameter value

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

AngularJS Reference Manual AngularJS Reference Manual