Angularjs ng-copy event example

Angular ng-cut, ng-copy, ng-paste Events Example

The example will help you understand and pay the on AngularJs ng-cut, ng-copy, ng-paste Events.

As an Example,

<!DOCTYPE html>
<html>
<head>
    <title>
        AngularJs ng-cut, ng-copy and ng-paste Events with Example
    </title>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
    <script type="text/javascript">
        var app = angular.module('myApp', []);
        app.controller('ngcopyCtrl', function ($scope) {
            $scope.cuttext = false;
            $scope.copytext = false;
            $scope.pasttext = false;
        });
    </script>
</head>
<body ng-app="myApp">
    <div ng-controller="ngcopyCtrl">
        <h2>As an Example for ng-cut, ng-copy and ng-paste Events in AngularJs</h2>
        <div>
            Copy the Text : <input type="text" ng-copy="copytext=true" value="Hi, You are Welcome!" />
            <span>The Text Is Copied :<b>{copytext }}</b></span>
            <hr />
        </div>
        <div>
            Cut the Text: <input type="text" ng-cut="cuttext=true" value="Hi, You are Welcome!" /> 
            <span>The Text Cut:<b>{cuttext }}</b></span>
            <hr /> 
        </div>
        <div>
            Paste the Text: <input type="text" ng-paste="pasttext=true" /> <br />
            <span>The Text Pasted:<b>{pasttext }}</b></span>
        </div>
    </div>
</body>
</html>


The live Result - output for play this example...
ANIL SINGH

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..
My Blogs - https://code-sample.com and https://code-sample.xyz
My Book1 - BEST SELLING ANGULAR BOOK (INCLUDING ALL VERSIONS 2, 4, 5, 6, 7)
My Book2 - ANGULAR 2 INTERVIEW QUESTIONS BOOK - Both Books are Available on WorldWide.

www.code-sample.com/. Powered by Blogger.
^