yalabot / angular-foundation

http://pineconellc.github.io/angular-foundation/
Other
1.05k stars 267 forks source link

typeahed problem in 1.4.1 [filter:notarray] Expected array but received: {} (in #243

Closed DinisCruz closed 8 years ago

DinisCruz commented 9 years ago

using the http://pineconellc.github.io/angular-foundation/#/typeahead example on angular 1.4.1 throws this error:

image

With angular 1.3.3 it works fine:

image

I think the problem is at

<input type="text" ng-model="asyncSelected" placeholder="Locations loaded via $http" typeahead="address for address in getLocation($viewValue) | filter:$viewValue" typeahead-loading="loadingLocations" class="form-control">
    <i ng-show="loadingLocations" class="glyphicon glyphicon-refresh"></i>
DinisCruz commented 9 years ago

note: the issue seems to be with the filter:$viewValue

mvarshavsky commented 9 years ago

Appear to be running into the same problem in 1.4.2

jbrowning commented 9 years ago

Thanks for the report. As noted in the docs, this library is compatible with Angular 1.2 and 1.3. We haven't upgraded to 1.4 yet as none of our internal apps have been upgraded yet. Any assistance from the community to get us on 1.4 would be appreciated.

jbrowning commented 8 years ago

This is due to the filter in the example's typeahead declaration and https://github.com/angular/angular.js/commit/cea8e75144e6910b806b63a6ec2a6d118316fddd.

"address for address in getLocation($viewValue) | filter:$viewValue"

Prior to 1.4, filters which were supplied with a non-array would silently return an empty array. Now they raise an error.

gregarega1993 commented 4 months ago

Any workaround for this?