* Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.
(fn)
| 5760 | * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed. |
| 5761 | */ |
| 5762 | function completeOutstandingRequest(fn) { |
| 5763 | try { |
| 5764 | fn.apply(null, sliceArgs(arguments, 1)); |
| 5765 | } finally { |
| 5766 | outstandingRequestCount--; |
| 5767 | if (outstandingRequestCount === 0) { |
| 5768 | while (outstandingRequestCallbacks.length) { |
| 5769 | try { |
| 5770 | outstandingRequestCallbacks.pop()(); |
| 5771 | } catch (e) { |
| 5772 | $log.error(e); |
| 5773 | } |
| 5774 | } |
| 5775 | } |
| 5776 | } |
| 5777 | } |
| 5778 | |
| 5779 | function getHash(url) { |
| 5780 | var index = url.indexOf('#'); |