Ng-Cut-3

 

In this exmple of Ng-Cut, We added a directive called ng-cut like:and user can't cut the code from input box. See the code

 
 
 
<!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="app"> <div ng-controller="controllerName" ng-init="isPaste=false"> <input ng-cut="cut($event)" ng-model="cpy" ng-keydown="kp($event)" /> </div> <script> var app = angular.module("app", []); app.controller('controllerName', ['$scope', function ($scope) { $scope.cpy = "Can not cut me!"; $scope.cut = function ($event) { console.log('cut', $event); $event.preventDefault(); }; }]); </script> </body> </html>
Output