私は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!';
};
});