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

Commit 6fb6a76

Browse files
Foxandxsspkozlowski-opensource
authored andcommitted
refactor(typeahead): remove unused code
Closes #1651
1 parent 594a64b commit 6fb6a76

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/typeahead/test/typeahead.spec.js

-4
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ describe('typeahead tests', function () {
274274
$templateCache.put('custom.html', '<p>{{ index }} {{ match.label }}</p>');
275275

276276
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>');
277-
var inputEl = findInput(element);
278277

279278
changeInputValueTo(element, 'Al');
280279

@@ -341,7 +340,6 @@ describe('typeahead tests', function () {
341340
$scope.$label = $label;
342341
};
343342
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>');
344-
var inputEl = findInput(element);
345343

346344
changeInputValueTo(element, 'Alas');
347345
triggerKeyDown(element, 13);
@@ -447,7 +445,6 @@ describe('typeahead tests', function () {
447445

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

452449
changeInputValueTo(element, 'b');
453450

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

518514
changeInputValueTo(element, 'match');
519515
$scope.$digest();

src/typeahead/typeahead.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
1212
return {
1313
parse:function (input) {
1414

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

0 commit comments

Comments
 (0)