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

[typeahead] Empty collection has single "undefined" element #6143

@macias

Description

@macias

Bug description:

If you pass an empty collection (by definition it does not contain any elements) it will happen that it has single "undefined" elements. The key elements to see this are:

uib-typeahead="foo(state) for state in getLocation()"

getLocation simply returns [] -- i.e. empty collection. And now all it takes is just check what will happen in foo. It will get an "undefined" element.

It is bad also because user has to know that as a result to getting undefined it is required to return "undefined" as well (not null, not empty string, but undefined). Otherwise the ng-model binding won't work.

Link to minimally-working plunker that reproduces the issue:

http://plnkr.co/edit/iokMQLjb2HvxETWdgnlg?p=preview

Version of Angular, UIBS, and Bootstrap

Angular: 1.5.5

UIBS: 2.0.1

Bootstrap: 3.3.6

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions