From aa38b3d707b42e206235073426feaef309d5a932 Mon Sep 17 00:00:00 2001 From: Andrea Epifani Date: Sat, 12 Sep 2015 12:15:22 +1000 Subject: [PATCH] Added onSelect callback and tabIndex value for the input field. --- angucomplete.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/angucomplete.js b/angucomplete.js index 734e9a2..d8b78a1 100644 --- a/angucomplete.js +++ b/angucomplete.js @@ -24,8 +24,10 @@ angular.module('angucomplete', [] ) "searchFields": "@searchfields", "minLengthUser": "@minlength", "matchClass": "@matchclass" + "onSelect": "&onselect", + "tabIndex": "@elementtabindex" }, - template: '
Searching...
No results found
{{ result.title }}
{{result.description}}
', + template: '
Searching...
No results found
{{ result.title }}
{{result.description}}
', link: function($scope, elem, attrs) { $scope.lastSearchTerm = null; @@ -192,6 +194,9 @@ angular.module('angucomplete', [] ) $scope.selectedObject = result; $scope.showDropdown = false; $scope.results = []; + if ($scope.onSelect) { + $scope.onSelect({item: result}); + } //$scope.$apply(); }