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

feature($http): parameter to avoid triggering $apply #14191

Closed
dragosrususv opened this issue Mar 7, 2016 · 3 comments
Closed

feature($http): parameter to avoid triggering $apply #14191

dragosrususv opened this issue Mar 7, 2016 · 3 comments

Comments

@dragosrususv
Copy link

PROBLEM: Complex pooling fed screens become unresponsive when they have 4-5 poolers at 2-3 seconds each.

SOLUTION: allow the developer to trigger $apply via $timeout(f(), 0) and allow him to opt out of the $digest cycle on each $http request

PROPOSAL:
$http({...., apply: false}) // by default the $apply will be triggered; if false, it will not be triggered

I can make a PR - just wanted to get in sync with the community, if they reached this problem.
Please mind that I'm forced to consider ReactJS like frameworks due to this limitation.

@dragosrususv dragosrususv changed the title feature($http): parameter to avoid triggering $apply on success/fail feature($http): parameter to avoid triggering $apply Mar 7, 2016
@lgalfaso
Copy link
Contributor

lgalfaso commented Mar 7, 2016

There are a few hurdles as $http uses $q extensively, but if the issues can be solved and the implementation is good, I see no problems.

BTW, do you know that there is $httpProvider#useApplyAsync that can partially solve this?

@Narretz
Copy link
Contributor

Narretz commented Mar 7, 2016

Duplicate of #2049

I'd be happy to include this in a future release.

Here's a PR that attempted to do this:
#12557

There's also this issue, which should be considered when implementing this: #13108

@Narretz Narretz closed this as completed Mar 7, 2016
@dragosrususv
Copy link
Author

@Narretz thank you kindly - tried to search before but haven't found the other ticket. I'm glad that this is not new to our community and people are interested in keeping good performance in large angularjs apps.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants