Angular.js – using ng-paste in angular.js
A simple Angular.js example of using the ng-paste directive with the AngularJS API to determine when the paste operation was performed.
<!DOCTYPE html>
<html ng-app="testApp">
<head>
<style>
</style>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="Tizen Angular.js example"/>
<title>Tizen Angular.js example</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/angular.min.js"></script>
<script>
var app = angular.module('testApp', []);
app.controller('AppController', function($scope) {
$scope.wasPasted = false;
});
</script>
</head>
<body>
<div ng-controller="AppController">
<input ng-paste='wasPasted=true' style='width: 300px' value='PASTE HERE SOME TEXT ;)'>
<br><br>
Was the text pasted? ==> {{ wasPasted }}
</div>
</body>
</html>