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

RFE: $browser to notify when there _are_ outstanding requests #299

Closed
arantius opened this issue Mar 4, 2011 · 6 comments
Closed

RFE: $browser to notify when there _are_ outstanding requests #299

arantius opened this issue Mar 4, 2011 · 6 comments

Comments

@arantius
Copy link
Contributor

arantius commented Mar 4, 2011

The $browser service currently provides notifyWhenNoOutstandingRequests(). I'd like the complement: notifyWhenOutstandingRequests() -- to show a loading message when there are outstanding requests, automatically. It might pass the number of outstanding requests, or even handles to the $xhr or $resource involved in the request.

@IgorMinar
Copy link
Contributor

I'm not sure if $browser is the right place for this. It feels too low level. How about $xhr instead?

@arantius
Copy link
Contributor Author

arantius commented Mar 4, 2011

It would make a lot of sense to me if both of these were on $xhr instead. I made a request for what I interpreted as the smallest change, since $browser already has what it has.

@IgorMinar
Copy link
Contributor

Our long term goal is to hide $browser from developer. It's really just an implementation detail of angular and right now we burden developers with knowing about it. That should not be the case.

+1 for exposing this functionality via $xhr

@arantius
Copy link
Contributor Author

arantius commented Mar 5, 2011

So, it turns out notifyWhenNoOutstandingRequests tracks things like $defer too, which is very much not what I want. So, a way for a controller to register for callbacks, or just the ability to watch something so that it can keep track of the number of XHR requests currently outstanding, and update the UI accordingly, would be great.

@IgorMinar
Copy link
Contributor

riiight... I recall that this was put in there so that the e2e test runner works with stuff flowing through the xhr cache.

Coincidentally we discussed this e2e integration in our team just recently and we have a very good idea how to clean up the apis and cover the abstraction that developers should not know about.

@mhevery
Copy link
Contributor

mhevery commented Jun 21, 2011

duplicate of #371

vojtajina added a commit to vojtajina/angular.js that referenced this issue Aug 12, 2011
Features:
- aborting requests
- more flexible callbacks (per status code)
- custom request headers (per request)
- access to response headers
- custom transform functions (both request, response)
- caching
- shortcut methods (get, head, post, put, delete, patch, jsonp)
- exposing pendingCount()

Breaks Takes one parameter now - configuration object
Breaks $xhr.cache removed - use configuration cache: true instead
Breaks $xhr.error, $xhr.bulk removed
Breaks Callback functions accepts parameters: response, status, headers

Closes angular#38
Closes angular#80
Closes angular#180
Closes angular#299
Closes angular#342
Closes angular#395
Closes angular#413
Closes angular#414
Closes angular#507
vojtajina added a commit to vojtajina/angular.js that referenced this issue Aug 23, 2011
Features:
- aborting requests
- more flexible callbacks (per status code)
- custom request headers (per request)
- access to response headers
- custom transform functions (both request, response)
- caching
- shortcut methods (get, head, post, put, delete, patch, jsonp)
- exposing pendingCount()
- setting timeout

Breaks renaming $xhr to $http
Breaks Takes one parameter now - configuration object
Breaks $xhr.cache removed - use configuration cache: true instead
Breaks $xhr.error, $xhr.bulk removed
Breaks Callback functions accepts parameters: response, status, headers

Closes angular#38
Closes angular#80
Closes angular#180
Closes angular#299
Closes angular#342
Closes angular#395
Closes angular#413
Closes angular#414
Closes angular#507
vojtajina added a commit to vojtajina/angular.js that referenced this issue Sep 2, 2011
Features:
- aborting requests
- more flexible callbacks (per status code)
- custom request headers (per request)
- access to response headers
- custom transform functions (both request, response)
- caching
- shortcut methods (get, head, post, put, delete, patch, jsonp)
- exposing pendingCount()
- setting timeout

Breaks renaming $xhr to $http
Breaks Takes one parameter now - configuration object
Breaks $xhr.cache removed - use configuration cache: true instead
Breaks $xhr.error, $xhr.bulk removed
Breaks Callback functions accepts parameters: response, status, headers

Closes angular#38
Closes angular#80
Closes angular#180
Closes angular#299
Closes angular#342
Closes angular#395
Closes angular#413
Closes angular#414
Closes angular#507
IgorMinar pushed a commit to IgorMinar/angular.js that referenced this issue Oct 21, 2011
Features:
- aborting requests
- more flexible callbacks (per status code)
- custom request headers (per request)
- access to response headers
- custom transform functions (both request, response)
- caching
- shortcut methods (get, head, post, put, delete, patch, jsonp)
- exposing pendingCount()
- setting timeout
Breaks renaming $xhr to $http
Breaks Takes one parameter now - configuration object
Breaks $xhr.cache removed - use configuration cache: true instead
Breaks $xhr.error, $xhr.bulk removed
Breaks Callback functions accepts parameters: response, status, headers
Closes angular#38
Closes angular#80
Closes angular#180
Closes angular#299
Closes angular#342
Closes angular#395
Closes angular#413
Closes angular#414
Closes angular#507
vojtajina added a commit to vojtajina/angular.js that referenced this issue Oct 27, 2011
Features:
- aborting requests
- more flexible callbacks (per status code)
- custom request headers (per request)
- access to response headers
- custom transform functions (both request, response)
- caching
- shortcut methods (get, head, post, put, delete, patch, jsonp)
- exposing pendingCount()
- setting timeout
Breaks renaming $xhr to $http
Breaks Takes one parameter now - configuration object
Breaks $xhr.cache removed - use configuration cache: true instead
Breaks $xhr.error, $xhr.bulk removed
Breaks Callback functions accepts parameters: response, status, headers
Closes angular#38
Closes angular#80
Closes angular#180
Closes angular#299
Closes angular#342
Closes angular#395
Closes angular#413
Closes angular#414
Closes angular#507
vojtajina added a commit to vojtajina/angular.js that referenced this issue Nov 21, 2011
Features:
- aborting requests
- more flexible callbacks (per status code)
- custom request headers (per request)
- access to response headers
- custom transform functions (both request, response)
- caching
- shortcut methods (get, head, post, put, delete, patch, jsonp)
- exposing pendingCount()
- setting timeout
Breaks Renaming $xhr to $http
Breaks Takes one parameter now - configuration object
Breaks $xhr.cache removed - use configuration cache: true instead
Breaks $xhr.error, $xhr.bulk removed
Breaks Callback functions get parameters: response, status, headers
Closes angular#38
Closes angular#80
Closes angular#180
Closes angular#299
Closes angular#342
Closes angular#395
Closes angular#413
Closes angular#414
Closes angular#507
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

4 participants