Skip to content

Instantly share code, notes, and snippets.

@congjf
Last active December 30, 2015 08:19
Show Gist options
  • Save congjf/7801857 to your computer and use it in GitHub Desktop.
Save congjf/7801857 to your computer and use it in GitHub Desktop.
Angular Service Register
AngularJS Service Register
angular.module('myModule', [], function($provide) {
$provide.factory('serviceId', function() {
var shinyNewServiceInstance;
//factory function body that constructs shinyNewServiceInstance
return shinyNewServiceInstance;
});
});
var myModule = angular.module('myModule', []);
myModule.factory('serviceId', function() {
var shinyNewServiceInstance;
//factory function body that constructs shinyNewServiceInstance
return shinyNewServiceInstance;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment