I'm encountering an issue while attempting to inject $ http to the factory. I received the following error in Angular 1.6:
Circular dependency found: $rootScope <- $http <- $exceptionHandler <- $rootScope <- $route
Here is what I have been working on so far:
var app = angular.module("app", []);
app
.controller("ctrl", function($scope) {
// controller
})
.factory('$exceptionHandler', ['$log', '$http', function($log, $http) {
return function myExceptionHandler(exception, cause) {
$log.warn(exception, cause);
// Only this line is causing the error
console.log($http);
}
}]);