* Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.
(fn)
| 6415 | * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed. |
| 6416 | */ |
| 6417 | function completeOutstandingRequest(fn) { |
| 6418 | try { |
| 6419 | fn.apply(null, sliceArgs(arguments, 1)); |
| 6420 | } finally { |
| 6421 | outstandingRequestCount--; |
| 6422 | if (outstandingRequestCount === 0) { |
| 6423 | while (outstandingRequestCallbacks.length) { |
| 6424 | try { |
| 6425 | outstandingRequestCallbacks.pop()(); |
| 6426 | } catch (e) { |
| 6427 | $log.error(e); |
| 6428 | } |
| 6429 | } |
| 6430 | } |
| 6431 | } |
| 6432 | } |
| 6433 | |
| 6434 | function getHash(url) { |
| 6435 | var index = url.indexOf('#'); |