Skip to content

Commit

Permalink
More results feature
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeCisco committed Jan 29, 2015
1 parent a766c20 commit be896f4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion angucomplete-alt.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'use strict';

angular.module('angucomplete-alt', [] )
.directive('angucompleteAlt', ['$q', '$parse', '$http', '$sce', '$timeout', '$templateCache', function ($q, $parse, $http, $sce, $timeout, $templateCache) {
.directive('angucompleteAlt', ['$q', '$parse', '$http', '$sce', '$timeout', '$location', '$templateCache', function ($q, $parse, $http, $sce, $timeout, $location, $templateCache) {
// keyboard events
var KEY_DW = 40;
var KEY_RT = 39;
Expand Down Expand Up @@ -58,6 +58,7 @@ angular.module('angucomplete-alt', [] )
require: '^?form',
scope: {
selectedObject: '=',
moreResults: '=',
disableInput: '=',
initialValue: '@',
localData: '=',
Expand Down Expand Up @@ -615,6 +616,12 @@ angular.module('angucomplete-alt', [] )
scope.currentIndex = index;
};

scope.getMoreResults = function () {
if (typeof scope.moreResults === 'function') {
scope.moreResults(scope.searchStr);
}
};

scope.selectResult = function(result) {
// Restore original values
if (isObject(scope.results[scope.currentIndex ])) {
Expand Down

0 comments on commit be896f4

Please sign in to comment.