* Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.
(fn)
| 6435 | * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed. |
| 6436 | */ |
| 6437 | function completeOutstandingRequest(fn) { |
| 6438 | try { |
| 6439 | fn.apply(null, sliceArgs(arguments, 1)); |
| 6440 | } finally { |
| 6441 | outstandingRequestCount--; |
| 6442 | if (outstandingRequestCount === 0) { |
| 6443 | while (outstandingRequestCallbacks.length) { |
| 6444 | try { |
| 6445 | outstandingRequestCallbacks.pop()(); |
| 6446 | } catch (e) { |
| 6447 | $log.error(e); |
| 6448 | } |
| 6449 | } |
| 6450 | } |
| 6451 | } |
| 6452 | } |
| 6453 | |
| 6454 | function getHash(url) { |
| 6455 | var index = url.indexOf('#'); |