-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Typehead broken when using promises in Angularjs 1.2.0rc2 #949
Comments
@overloadnn http://plnkr.co/, please |
The problem may not necessarily be related to promises but typeahead itself |
@vpixle what you see is duplicate of #813 and is already fixed in master via 7589339. @overloadnn do you have other reproduce scenario? |
Pawel, give me a second to test it. I have just downloaded a "NEW" version from a http://angular-ui.github.io/bootstrap/ where is a jumbotron loadbutton that points to https://github.com/angular-ui/bootstrap/tree/gh-pages page that is featuring a month old ui-bootstrap-tpls-0.5.0.min.js IMHO the https://github.com/angular-ui/bootstrap/tree/gh-pages should be blocked or at least the 0.5.0 file 2B deleted. |
http://plnkr.co/edit/SXcZXTemPWz3snIUniwb Switch between versions of angular in index.html and you'll see. |
Here's the commit from angular which broke using promise with typeahead: The error: |
@countableSet thnx for looking into this! Indeed, seems like |
For anyone else affected by this, here's the dirty hack I came up with to work around the issue until a real solution is found:
|
@wilsonjackson I came up with the same solution. This, however, breaks the angular change that was made for watching function changes: $scope.$watch('functionThatReturnsAPromise', function (newValue, oldValue) {
debugger;
}); |
I can confirm this, I have the same issue while returning a |
Yeh, RC2 broken several things pretty bad... I really need to discuss this issue with the core team as for now I don't see any straightforward solution. The work-around proposed by @wilsonjackson is the best we've got for now. |
When a parsed function call returns a promise, the evaluated value is the resolved value of the promise rather than the promise object. Closes #3503
wilsonjackson's solution is not working for me. I'm using 1.2.0-rc.2 and bootrstrap-ui 0.6.0 (bootstrap3_bis2) |
It will not work unless you keep a cache of the promises and return the same promise for the same parameter. |
Is there any plunker (angularjs 1.2.0rc2 & angular-ui bs 0.6) with a working temporary solution ? I can't get this working any way. |
IMHO it is clearly an angular.js issue, I had to modify my angular.js as in xrg/angular.js@34b8650 to let it work again Doing a workaround with a promise cache would set a bad precedent, where all developers need to write that much code for every promise. |
Hopefully this is going to be addressed on the AngularJS side via angular/angular.js#4158 |
Yay, it was fixed on the AngularJS side!!! The current AngularJS master works perfectly: Closing, we just need to wait for RC3 now! |
RC3 is out, works fine! http://code.angularjs.org/1.2.0-rc.3/ |
This is still broken with the latest stable release of angular 1.2.1. It only works if you are not trying to display a property of the resulting objects. If your result set isn't just a list of strings it still is broken. Plunkr based on pkozlowski-opensource's but with two properties in the result set objects: |
@JaggyGT use proper syntax: http://plnkr.co/edit/SyDvessCC2hk23VpFL1m?p=preview |
ah, I see now - state.name for state in states. Thanks @pkozlowski-opensource! |
On search, I get a "Error: matches is undefined" exception.
The text was updated successfully, but these errors were encountered: