Angularjs : Using common service in different modules
问题 I am trying to use the same service for different modules. There are many modules so i tried to inject them in a parent module. Something like this: var app=angular.module('myapp',['module_1','module_2',....,'module_n']); var module_1=angular.module('myapp1',[]); var module_2=angular.module('myapp2',[]); var module_3=angular.module('myapp3',[]); . . . var module_n=angular.module('myappN',[]); and the service which is common to all the n modules is like this: .service('myService',function(){ .