Below is one case that I recently encountered, I tried to enter the "myService" service in Factoy and received the following error.
**Uncaught Error:** *[$injector:cdep] Circular dependency found: $http <- $modal <- myService <- interceptorFactory <- $http <- $templateRequest <- $compile* [http://errors.angularjs.org/1.3.0/$injector/cdep?p0=%24http%20%3C-%20%24mod%E2%80%A6orFactory%20%3C-%20%24http%20%3C-%20%24templateRequest%20%3C-%20%24compile][1]
To solve this problem, $ injector became a lifeguard
var service = $injector.get('myService')
and now you can use this service in the same way as you used other services in your application.
MechanicalCoder Apr 23 '15 at 9:56 2015-04-23 09:56
source share