2011-07-17 08:05:43 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
2011-02-15 06:12:45 +00:00
|
|
|
/**
|
|
|
|
|
* @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
|
2011-11-10 05:18:34 +00:00
|
|
|
* {@link angular.module.NG_MOCK.$exceptionHandler mock $exceptionHandler}
|
2011-02-15 06:12:45 +00:00
|
|
|
*
|
|
|
|
|
* @example
|
|
|
|
|
*/
|
2011-11-02 23:32:46 +00:00
|
|
|
function $ExceptionHandlerProvider(){
|
|
|
|
|
this.$get = ['$log', function($log){
|
|
|
|
|
return function(e) {
|
|
|
|
|
$log.error(e);
|
|
|
|
|
};
|
|
|
|
|
}];
|
|
|
|
|
}
|