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

Typeahead(Asynchronous results) doesn't works with Angular 1.4 #3789

Closed
jakubkowalczyk-pl opened this issue Jun 10, 2015 · 7 comments
Closed

Comments

@jakubkowalczyk-pl
Copy link

Error: [filter:notarray] Expected array but received: {}
http://errors.angularjs.org/1.4.0/filter/notarray?p0=%7B%7D

@pkozlowski-opensource
Copy link
Member

@dosapati
Copy link

Getting same error and the issue only comes when you use filter with Async HTTP Request
Here is the example:
http://plnkr.co/edit/uj82lr53GdnRs9s6Z4eF?p=preview

Please suggest if u have a quick solution, trying to find a workaround by my self too...

@allentong
Copy link

+1

@xtreemrage
Copy link

Getting the same error as @dosapati plunker, with an async call, this has changed since 1.4.x. It will work if you remove the filter, see plunker.

This only happens if I do an async call, if I already have the list (array), it works like it should (with filter:$viewValue).

I use angular v1.4.x and angular-bootstrap v0.12.1 (same error with: v0.13.0). How to resolve, is the filter needed?

@pkozlowski-opensource
Copy link
Member

Guys, the way you use fitter suggest that you want to apply a filter to a ... promise which obviously doesn't make sense. You need to filter the results in the JS code, see: #1740

@xtreemrage
Copy link

@pkozlowski-opensource thanks, didn't think about that ffs, fixed for me. You don't need the $filter of course if your back-end is filtering them.

@pkozlowski-opensource
Copy link
Member

You don't need the $filter of course if your back-end is filtering them.

Right, this is the usual approach. But you still might want to do some adjustments on the client side. Anyway, this works as expected, nothing to fix here.

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

5 participants