Skip to content

Instantly share code, notes, and snippets.

@sampepose
Created January 6, 2014 04:27
Show Gist options
  • Save sampepose/8278249 to your computer and use it in GitHub Desktop.
Save sampepose/8278249 to your computer and use it in GitHub Desktop.
Factory with $injector example
angular.module("myModule", [
"module.that.contains.serviceA"
]
).factory("myFactory", ["$injector", function ($injector) {
return {
example: function () {
var serviceA = $injector.get("serviceA");
serviceA.visible = false;
}
}
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment