Answer the question
In order to leave comments, you need to log in
Why does the $injector:cdep Circular Dependency error occur?
There is a service for issuing messages:
angular.module('Notes',['ui.bootstrap']);
angular
.module('Notes')
.service('Srv', Srv);
Srv.$inject = ['$uibModal'];
function Srv ($uibModal) {
this.say = function(msg) {
...
}
return this;
}
angular
.module('app')
.controller('PCC' , PCC);
PCC.$inject = ['Srv'];
function PCC(Srv) {
Srv.say('message');
}
angular
.module('app', ['ngResource', 'Notes'])
Interceptor = angular.module('app')
.factory('Interceptor',['Srv',function(Srv)
{ var Interceptor = {
'response': function(response) {
Srv.say('message');
}
}
return Interceptor;
}]);
angular
.module('app')
.config(['$httpProvider',
function($httpProvider) {
$httpProvider.interceptors.push('Interceptor');
}]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question