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=""> <head> <title>Welcome to LearnKode - A code learning platform</title> <script src=""></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>