ng-copy example

ng-copy is specify custom behavior on copy event.
Read more at AngularJs doc

Please run below code to learn.


 <html>  
 <head>  
   <title>Angular JS Directive</title>  
   <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>  
   <script>  
     angular.module('MyForm', [])  
       .controller('myController', ['$scope', function ($scope) {  
       }]);  
   </script>  
 </head>  
 <body ng-app="MyForm">  
   <div ng-controller="myController">  
     <h3>How to use ng-copy</h3>  
     <input ng-copy="copied=true" style="width:200px" ng-init="copied=false; textvalue='Select me and then copy me'" ng-model="textvalue">  
     You just copied me: {{copied}}  
   </div>  
 </body>  
 </html>   



Thanks for your time reading.



No comments:

Post a Comment

Popular Posts