angular.service.$xhr.error

Work in Progress This page is currently being revised. It might be incomplete or contain inaccuracies.

Description

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.

Dependencies

Usage

error(request, response);

Parameters

Example

  fetch a non-existent file and log an error in the console:
  <button ng:click="$service('$xhr')('GET', '/DOESNT_EXIST')">fetch</button>