diff --git a/src/typeahead/test/typeahead.spec.js b/src/typeahead/test/typeahead.spec.js index b586e3e83c..f942ed909e 100644 --- a/src/typeahead/test/typeahead.spec.js +++ b/src/typeahead/test/typeahead.spec.js @@ -232,14 +232,14 @@ describe('typeahead tests', function () { it('should support custom templates for matched items', inject(function ($templateCache) { - $templateCache.put('custom.html', '
{{ match.label }}
'); + $templateCache.put('custom.html', '{{ index }} {{ match.label }}
'); var element = prepareInputEl(""); var inputEl = findInput(element); changeInputValueTo(element, 'Al'); - expect(findMatches(element).eq(0).find('p').text()).toEqual('Alaska'); + expect(findMatches(element).eq(0).find('p').text()).toEqual('0 Alaska'); })); }); diff --git a/src/typeahead/typeahead.js b/src/typeahead/typeahead.js index 2e864f01e0..4274b0a00c 100644 --- a/src/typeahead/typeahead.js +++ b/src/typeahead/typeahead.js @@ -284,6 +284,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position']) return { restrict:'E', scope:{ + index:'=', match:'=', query:'=' }, diff --git a/template/typeahead/typeahead-popup.html b/template/typeahead/typeahead-popup.html index f0efda19fa..69707cefe5 100644 --- a/template/typeahead/typeahead-popup.html +++ b/template/typeahead/typeahead-popup.html @@ -1,5 +1,5 @@ \ No newline at end of file