Closed brenjt closed 9 years ago
I have just had the same problem. The issue arises that inside of "Notification" there is a dependency on $http
and $templateCache
.
What I have done and which seems to work is to delay the construction of Notification
until it's needed in the interceptor.
.factory('baseHttpInterceptor', function ($injector) {
var notification = null;
var getNotification = function() {
if (!notification) {
notification = $injector.get('Notification');
}
return notification;
};
return {
'responseError': function() {
getNotification().error('Oops');
}
};
});
Awesome, that worked great. Thank you! I would still like to see an actual fix though.
@MarkPerryBV Thanks! I was having the same problem
thank you @MarkPerryBV :+1:
I think it wasn't the ui-notification's error. It's because angular's injector cannot correctly inject some services to interceptors. I've seen this trouble using another modules. So, I'm closing issue.
I am having this exact same issue: https://github.com/alexcrack/angular-ui-notification/issues/29
I tried the code and I did not have any success.
Circular dependency error:
Any ideas?