-
Notifications
You must be signed in to change notification settings - Fork 27.4k
refactor($http): remove unneeded call to $apply #13128
Conversation
c2e24b9
to
305dd5d
Compare
@thorn0, I finally got around to taking a proper look. It generally lgtm, with the exceptions of the changes to tests. It's too much imo (and this doesn't properly reflect the fact that the actual implications in behaviour are minimal). @petebacondarwin, I guess we are OK with the BC for So, are we OK with having |
See gkalpak@e00f10c (wrt to the test changes). |
@gkalpak My main objection against your cleanup is that if we leave
Actually, lots of code relies on this. And this code is unit tests. That's why |
FWIW I stumbled upon this PR while investigating why setting |
We are not going to get this into 1.5.0. |
What ever happened to this? What do people think about something like this or maybe just removing |
Can we probably at least deprecate |
What is wrong with |
Internally it's used only in |
305dd5d
to
1e1f91c
Compare
This `$apply` call was needed only for tests, so it's been moved to `$httpBackend.flush`. BREAKING CHANGE: `$httpProvider.useApplyAsync` has been removed. Closes angular#13108 Closes angular#13111
1e1f91c
to
055332d
Compare
Thanks for this @thorn0 - at this point in the project's lifecycle we don't feel that this adds enough value to be worth the potential breaking change. So we are going to close this as won't merge. |
@petebacondarwin We should've at least removed/deprecated |
AFAICT, with |
Oh, right. So why not make it the default behavior? |
Because it might be a breaking change. In retrospect, I'm not sure why we didn't do it for 1.7.0 😕 |
This
$apply
call was needed only for tests, so it's been moved to$httpBackend.flush
. An example of such a test can be found inngIncludeSpec.js
. It fails if$digest
isn't synchronously invoked after each response. See also the comments I included in the code of the tests.BREAKING CHANGE:
$httpProvider.useApplyAsync
was removedCloses #13108
Closes #13111