* Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.
(fn)
| 4409 | * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed. |
| 4410 | */ |
| 4411 | function completeOutstandingRequest(fn) { |
| 4412 | try { |
| 4413 | fn.apply(null, sliceArgs(arguments, 1)); |
| 4414 | } finally { |
| 4415 | outstandingRequestCount--; |
| 4416 | if (outstandingRequestCount === 0) { |
| 4417 | while(outstandingRequestCallbacks.length) { |
| 4418 | try { |
| 4419 | outstandingRequestCallbacks.pop()(); |
| 4420 | } catch (e) { |
| 4421 | $log.error(e); |
| 4422 | } |
| 4423 | } |
| 4424 | } |
| 4425 | } |
| 4426 | } |
| 4427 | |
| 4428 | function getHash(url) { |
| 4429 | var index = url.indexOf('#'); |