-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix(autocomplete): do not use .then() for $http promise #6860
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
1 similar comment
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
1 similar comment
CLAs look good, thanks! |
Related and fixed in #6521. Close this PR. |
I think I don't agree that this is fixed by #6521. In my opinion these are two different issues. |
This issues is actually what I asked in my comment on de423ae48d593c08f0277376b7e3e80571a3ba48. That commit actually removed So I support this pull request. 👍 |
I double checked the content of both PR and I am pretty sure, as @winniehell says, that both issues are completely different : the problem here is that when using autocomplete with $http promise, we use successively both .success() and .then() methods :
this part of the code is not changed by the PR you mentionned : it lacks an @ThomasBurleson : I didn't say that we should not listen for |
$http returns promise with both .then() and .success() methods :
.then()
: calls back with http response object with following properties : data, status, config, headers, statusText (cf https://docs.angularjs.org/api/ng/service/$http#general-usage).success()
: calls back with data coming from servercurrently, autocomplete use both methods, and when
handleResults
is called from.then(...)
, items are replaced by http response object