* Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.
(fn)
| 6041 | * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed. |
| 6042 | */ |
| 6043 | function completeOutstandingRequest(fn) { |
| 6044 | try { |
| 6045 | fn.apply(null, sliceArgs(arguments, 1)); |
| 6046 | } finally { |
| 6047 | outstandingRequestCount--; |
| 6048 | if (outstandingRequestCount === 0) { |
| 6049 | while (outstandingRequestCallbacks.length) { |
| 6050 | try { |
| 6051 | outstandingRequestCallbacks.pop()(); |
| 6052 | } catch (e) { |
| 6053 | $log.error(e); |
| 6054 | } |
| 6055 | } |
| 6056 | } |
| 6057 | } |
| 6058 | } |
| 6059 | |
| 6060 | function getHash(url) { |
| 6061 | var index = url.indexOf('#'); |