我有一个main module
和一些submodules
。我正在注入submodules
. mainmodule
现在我想访问`子模块的服务-我该怎么做?
var myApp = angular.module('myApp', [
'AuthenticationModule',
]);
myApp.controller('TestController', function($scope, 'AuthenticationModule') {
/* How do I use the service? */
$scope.testVar = AuthenticationModule.SERVICE?????
});
和submodule
var AuthenticationModule = angular.module('AuthenticationModule', []);
AuthenticationModule.service('TestService', function() {
this.testFunction = function() {
return 'You successfully got me!';
};
});