Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

fix(typeahead): remove unused code #1651

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/typeahead/test/typeahead.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ describe('typeahead tests', function () {
$templateCache.put('custom.html', '<p>{{ index }} {{ match.label }}</p>');

var element = prepareInputEl('<div><input ng-model="result" typeahead-template-url="custom.html" typeahead="state as state.name for state in states | filter:$viewValue"></div>');
var inputEl = findInput(element);

changeInputValueTo(element, 'Al');

Expand Down Expand Up @@ -341,7 +340,6 @@ describe('typeahead tests', function () {
$scope.$label = $label;
};
var element = prepareInputEl('<div><input ng-model="result" typeahead-on-select="onSelect($item, $model, $label)" typeahead="state.code as state.name for state in states | filter:$viewValue"></div>');
var inputEl = findInput(element);

changeInputValueTo(element, 'Alas');
triggerKeyDown(element, 13);
Expand Down Expand Up @@ -447,7 +445,6 @@ describe('typeahead tests', function () {

it('issue 231 - closes matches popup on click outside typeahead', function () {
var element = prepareInputEl('<div><input ng-model="result" typeahead="item for item in source | filter:$viewValue"></div>');
var inputEl = findInput(element);

changeInputValueTo(element, 'b');

Expand Down Expand Up @@ -513,7 +510,6 @@ describe('typeahead tests', function () {
});
};
var element = prepareInputEl('<div><input ng-model="result" typeahead-min-length="2" typeahead-loading="isLoading" typeahead="item for item in items($viewValue)"></div>');
var inputEl = findInput(element);

changeInputValueTo(element, 'match');
$scope.$digest();
Expand Down
2 changes: 1 addition & 1 deletion src/typeahead/typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
return {
parse:function (input) {

var match = input.match(TYPEAHEAD_REGEXP), modelMapper, viewMapper, source;
var match = input.match(TYPEAHEAD_REGEXP);
if (!match) {
throw new Error(
'Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_"' +
Expand Down