Last active
December 30, 2015 08:19
-
-
Save congjf/7801857 to your computer and use it in GitHub Desktop.
Angular Service Register
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AngularJS Service Register |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('myModule', [], function($provide) { | |
$provide.factory('serviceId', function() { | |
var shinyNewServiceInstance; | |
//factory function body that constructs shinyNewServiceInstance | |
return shinyNewServiceInstance; | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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