Angularjs Examples

AJS Examples


AngularJS ng-copy Directive

The AngularJS ng-copy directive is used specify custom behavior on copy event.

Syntax

<input ng-copy="copied=true" ng-init="copied=false; value='copy this text'" ng-model="value"> 

AngularJS ng-copy Directive Example

<!DOCTYPE html>      
<html>      
<head> <!-- www.techstrikers.com -->      
<title>ngCopy Test Sample</title>   
      
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js"></script>      
  
</head>      
<body style="background-color:#DDE4E9;" ng-app="">      
  <fieldset style="background-color:#DDE4E9;">        
    <legend>AngulerJS ngCopy Example</legend>  
  
<input ng-copy="copied=true" ng-init="copied=false; value='copy this text'" ng-model="value">
<p style="font-family:Arial;color:red;background:steelblue;padding:3px;width:350px;"     
        ng-show='copied'>Text copied</p>  
      
 </fieldset>       
</body>      
</html> 
See Live Example