* Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.
(fn)
| 6475 | * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed. |
| 6476 | */ |
| 6477 | function completeOutstandingRequest(fn) { |
| 6478 | try { |
| 6479 | fn.apply(null, sliceArgs(arguments, 1)); |
| 6480 | } finally { |
| 6481 | outstandingRequestCount--; |
| 6482 | if (outstandingRequestCount === 0) { |
| 6483 | while (outstandingRequestCallbacks.length) { |
| 6484 | try { |
| 6485 | outstandingRequestCallbacks.pop()(); |
| 6486 | } catch (e) { |
| 6487 | $log.error(e); |
| 6488 | } |
| 6489 | } |
| 6490 | } |
| 6491 | } |
| 6492 | } |
| 6493 | |
| 6494 | function getHash(url) { |
| 6495 | var index = url.indexOf('#'); |