Ng-DoubleClick-8

 

When we double click on selected value which bind to pattern variable will call the dblClick() function that alert the selected value.

 
 
 
<!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"> Double click on list data: <br /> <select size="4" ng-model="pattern" ng-dblclick="dblClick(pattern)" ng-options="p.name as p.name for p in names"></select> </div> <script> var app = angular.module("clickExample", []); app.controller('ExampleController', ['$scope', function ($scope) { $scope.names = [{ name: 'First' }, { name: 'Second' }, { name: 'Third' }, { name: 'Four' }]; $scope.dblClick = function (ptrn) { alert(ptrn) } }]); </script> </body> </html>
Output