Ng-Copy-Ng-Past-3

 

In this example we can set the value of isCopy=true on ng-copy event(when we copy the text from tetxarea) and display it below.By default value of isCopy variable is false which is set by ng-init directive.

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> </head> <body ng-app> <div ng-init="isCopy=false;copyValue='Copy me!'"> Copy here: <textarea ng-copy="isCopy=true" ng-model="copyValue"></textarea> <br /> <pre>Copied: {{isCopy}}</pre> </div> </body> </html>
Output