mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-21 08:50:24 +00:00
now that we require DI everywhere, we don't need any of these services to be eager - they get initialized when and only when they are requested.
22 lines
694 B
JavaScript
22 lines
694 B
JavaScript
/**
|
|
* @workInProgress
|
|
* @ngdoc service
|
|
* @name angular.service.$exceptionHandler
|
|
* @requires $log
|
|
*
|
|
* @description
|
|
* Any uncaught exception in angular expressions is delegated to this service.
|
|
* The default implementation simply delegates to `$log.error` which logs it into
|
|
* the browser console.
|
|
*
|
|
* In unit tests, if `angular-mocks.js` is loaded, this service is overriden by
|
|
* {@link angular.mock.service.$exceptionHandler mock $exceptionHandler}
|
|
*
|
|
* @example
|
|
*/
|
|
var $exceptionHandlerFactory; //reference to be used only in tests
|
|
angularServiceInject('$exceptionHandler', $exceptionHandlerFactory = function($log){
|
|
return function(e) {
|
|
$log.error(e);
|
|
};
|
|
}, ['$log']);
|