AngularJS ng-copy Instruction
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"
<
/elementAll HTML elements are supported.
Parameter value
| Value | Description |
|---|---|
| expression | The expression to execute when the element text is copied. |
AngularJS Reference Manual