bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

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

Open jakubkowalczyk-pl opened this issue 11 years ago • 7 comments

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

jakubkowalczyk-pl avatar Jun 10 '15 07:06 jakubkowalczyk-pl

Plunker, please: https://github.com/angular-ui/bootstrap/blob/master/CONTRIBUTING.md#you-think-youve-found-a-bug

I can't reproduce with the example from our demo page: http://plnkr.co/edit/vTB8bWad9MuEMB7kX1CM?p=preview

pkozlowski-opensource avatar Jun 10 '15 08:06 pkozlowski-opensource

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...

dosapati avatar Jun 18 '15 18:06 dosapati

+1

allentong avatar Jun 19 '15 23:06 allentong

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?

xtreemrage avatar Jun 23 '15 13:06 xtreemrage

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: https://github.com/angular-ui/bootstrap/issues/1740

pkozlowski-opensource avatar Jun 23 '15 13:06 pkozlowski-opensource

@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.

xtreemrage avatar Jun 23 '15 13:06 xtreemrage

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.

pkozlowski-opensource avatar Jun 23 '15 13:06 pkozlowski-opensource