Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Why is the call to $apply needed in $http? #13108

Closed
@thorn0

Description

@thorn0

I started to think about it looking at #12557. At first glance the answer is obvious: we need to update the views after we got a response, so we trigger a digest. But hey, it'll be triggered anyway because $http uses $q internally. And when a $q deferred is resolved, it schedules a digest. So can't we just remove that call to $rootScope.$apply (with all the $applyAsync thing altogether)? Am I missing something? If it's needed only for the tests, the $apply call should be moved to $httpBackend.flush.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions