-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Typeahead promise bug in Angular 1.4.x Error: [filter:notarray] #1567
Comments
Caused by this breaking change: angular/angular.js#9992 |
That bug cites IE9. Sorry I didn't mention my browser, was using Chrome Version 41.0.2272.89 (64-bit). So did they make a fix for IE9 that caused this bug? |
bump - having this issue too and can't switch dependencies away from Angular beta... |
Is this on the road to fix - i cannot update to angular 1.4 either because of this. .:(
|
@mrweiland you can try my fix, but I guess it is going to take a bit more time to fix the failing tests |
We're having this problem as well, with Angular-Strap 2.2.2 and AngularJS 1.4.1 Line 1719 in angular-strap.js
Then AngularJS calls Line 18220 in angular.js
Here
Is this a issue in Angular-Strap or in AngularJS 1.4.x ? |
Having this issue, sans angular-strap. Trying to use filter to search through an array set in the front end, that is being 'track by $index', but its telling me the same error as everyone else. This is holding me back from updating. Error: [filter:notarray] Expected array but received: 0 |
My fix is working. in promise set data to this array. On your input with typeahead set ng-change="$scope.promiseFunc()" and typeahead="obj for object in dataArr | filter:$viewValue " |
How do I pass current input value to the promiseFunc? |
$scope.promiseFunc($viewValue) |
tried that, viewValue is undefined. I ended up using the variable in ng-model. But this workaround shows search results only a character after user input which is not so great... Can this issue be reopen? The try catch does not really fix this... |
Never mind, Updated to latest angular (1.4.3) and angularstarp solved my issue. |
@HarelM what did you do to fix this besides updating to 1.4.3 and installing angularstrap? |
That was it, but I ended up not using it since I needed to show search results and allow the user to select and pan my map. |
@HarelM so you couldn't fix this problem neither. Did you create your own typeahead? |
Here is my site: |
@HarelM I was with the same issue with the filter logic in the typeahead repeat, I was doing this:
... and the was getting the error message from angular saying he can't handle objects in the filter. After some debugging I saw that by making this: ...
return users.getByName(name)
.then(function(result){
return result.data.map(function(user){
// "user" is a object full of user information,
// like his avatar, id, name, email, etc...
return user;
});
});
... I was, in fact, transforming my returned array of users in an Object and AngularJS was correct when he was throwing me errors... Ok, so I tried @spamforhope suggestion, It worked, but not with the results I wanted and then I returned to the main example here: http://angular-ui.github.io/bootstrap/#/typeahead I paid real attention to the examples there and noticed the third example, "Custom templates for results" and tried what it suggests:
... and worked like a charm! The difference between the two loop logics? In the second I'm using the Edit: |
I have the same issue, so i change in version 2.3.6 in angular-strap.js on line 711:
to:
I use angular 1.4.7 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I know that 1.4 is still in beta but I wanted to cal this out. When passing a promise to bs-options angular throws the below error:
The text was updated successfully, but these errors were encountered: