* Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.
(fn)
| 4936 | * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed. |
| 4937 | */ |
| 4938 | function completeOutstandingRequest(fn) { |
| 4939 | try { |
| 4940 | fn.apply(null, sliceArgs(arguments, 1)); |
| 4941 | } finally { |
| 4942 | outstandingRequestCount--; |
| 4943 | if (outstandingRequestCount === 0) { |
| 4944 | while (outstandingRequestCallbacks.length) { |
| 4945 | try { |
| 4946 | outstandingRequestCallbacks.pop()(); |
| 4947 | } catch (e) { |
| 4948 | $log.error(e); |
| 4949 | } |
| 4950 | } |
| 4951 | } |
| 4952 | } |
| 4953 | } |
| 4954 | |
| 4955 | function getHash(url) { |
| 4956 | var index = url.indexOf('#'); |