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

Commit

Permalink
refactor(typeahead): remove unused code
Browse files Browse the repository at this point in the history
Closes #1651
  • Loading branch information
Foxandxss authored and pkozlowski-opensource committed Jan 22, 2014
1 parent 594a64b commit 6fb6a76
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
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

0 comments on commit 6fb6a76

Please sign in to comment.