Angularjs Examples

AJS Examples


AngularJS ng-paste Directive

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

Syntax

<input ng-paste="paste=true" ng-init="paste=false" placeholder='paste here'> 

AngularJS ng-paste Directive Example

<!DOCTYPE html>      
<html>      
<head> <!-- www.techstrikers.com -->      
<title>ngPaste 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 ngPaste Example</legend>  
  
<input ng-paste="paste=true" ng-init="paste=false" placeholder='paste here'> 
<p style="font-family:Arial;color:red;background:steelblue;padding:3px;width:350px;"     
        ng-show='paste'>Text pasted</p>  
      
 </fieldset>       
</body>      
</html> 
See Live Example