Error handler for $xhr service
. An application can replaces this
service with one specific for the application. The default implementation logs the error to
$log.error
.
error(request, response);
request – {Object} –
Request object.
The object has the following properties
method
â {string}
â The http request method.url
â {string}
â The request destination.data
â `{(string|Object)=} â An optional request body.callback
â {function()}
â The callback functionresponse – {Object} –
Response object.
The response object has the following properties:
fetch a non-existent file and log an error in the console: <button ng:click="$service('$xhr')('GET', '/DOESNT_EXIST')">fetch</button>