Skip to content

Instantly share code, notes, and snippets.

@ronapelbaum
Created July 6, 2016 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ronapelbaum/0b2ad949d11a27dfaaab32665dc3f8c5 to your computer and use it in GitHub Desktop.
Save ronapelbaum/0b2ad949d11a27dfaaab32665dc3f8c5 to your computer and use it in GitHub Desktop.
example of angular "modules" issue
angular.module('moduleA', []).service('ServiceA', function() {
this.getName = function() {
return 'bob';
}
});
angular.module('moduleB', []).service('ServiceB', ['ServiceA', function(ServiceA) {
this.greet = function() {
return 'Hello ' + ServiceA.getName()
}
}]);
angular.module("app", ['moduleA', 'moduleB'])
.controller("myCtrl", function(ServiceB) {
this.data = ServiceB.greet();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment