AngularJS ng-copyDirective
AngularJS Example
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 Yourself »
Definition and Usage
ng-copyThe directive is used to tell AngularJS what to do when the text of an HTML element is copied.
ng-copyThe ng-copy directive does not override the element's original oncopy event. When the event is triggered,ng-copyBoth the expression and the original oncopy event will be executed.
Syntax
<element ng-copy="expression"></element>
Supported by all HTML elements.
Parameter Value
| Value | Description |
|---|---|
| expression | The expression to execute when the element's text is copied. |
Other Extensions
AngularJS Reference Manual