This service handles the lifecycle of callbacks to handle JSONP requests. Override this service if you wish to customise where the callbacks are stored and how they vary compared to the requested url.
createCallback(url);
$httpBackend calls this method to create a callback and get hold of the path to the callback
to pass to the server, which will be used to call the callback with its payload in the JSONP response.
| Param | Type | Details |
|---|---|---|
| url | string |
the url of the JSONP request |
| string | the callback path to send to the server as part of the JSONP request |
wasCalled(callbackPath);
$httpBackend calls this method to find out whether the JSONP response actually called the
callback that was passed in the request.
| Param | Type | Details |
|---|---|---|
| callbackPath | string |
the path to the callback that was sent in the JSONP request |
| boolean | whether the callback has been called, as a result of the JSONP response |
getResponse(callbackPath);
$httpBackend calls this method to get hold of the data that was provided to the callback
in the JSONP response.
| Param | Type | Details |
|---|---|---|
| callbackPath | string |
the path to the callback that was sent in the JSONP request |
| * | the data received from the response via the registered callback |
removeCallback(callbackPath);
$httpBackend calls this method to remove the callback after the JSONP request has
completed or timed-out.
| Param | Type | Details |
|---|---|---|
| callbackPath | string |
the path to the callback that was sent in the JSONP request |