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

do not name your typeahead scope query method "query()" #1238

Closed
alank64 opened this issue Nov 8, 2013 · 1 comment
Closed

do not name your typeahead scope query method "query()" #1238

alank64 opened this issue Nov 8, 2013 · 1 comment

Comments

@alank64
Copy link

alank64 commented Nov 8, 2013

when defining your query scope method for typeahead, if you name it "query()" and call this from your typeahead as so:

<input type="text" ng-model="selected" typeahead="n.name for n in query($viewValue)">

The query method will never get called. Since "match" is never set and remains 'undefined', therefore attempt to call length() on undefined error. If name scope can't be protected from the calling scope, I would suggest that this be documented since the code comments state that 'match', 'query'... are grouped as to not pollute the scope, which is a little misleading.

AngularJS 1.1.3
ui-bootstrap-tpls: 0.6.0

@pkozlowski-opensource
Copy link
Member

@alank64 this was a real bug with scopes collision, it is fixed in master now, will be part of the next release. Thnx for taking time to report this one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants