Ng-DoubleClick-6

 

In this example if we double click on the button it will call the copyText() function which will copy the text of first textbox to the second textbox.

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Welcome to LearnKode - A code learning platform</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> </head> <body ng-app="clickExample"> <div ng-controller="ExampleController"> Text1: <input type="text" name="Text1" ng-model="Text1" /><br /> Text2: <input type="text" name="Text2" ng-model="Text2" /><br /> <button ng-dblclick="copyText()">Copy Text</button> </div> <script> var app = angular.module("clickExample", []); app.controller('ExampleController', ['$scope', function ($scope) { $scope.Text1 = 'LearnIt'; $scope.copyText = function () { $scope.Text2 = $scope.Text1; }; }]); </script> </body> </html>
Output