Skip to content

Instantly share code, notes, and snippets.

@jasonaden
Created May 6, 2014 00:09
Show Gist options
  • Save jasonaden/b1f14fb7273d9d8a0731 to your computer and use it in GitHub Desktop.
Save jasonaden/b1f14fb7273d9d8a0731 to your computer and use it in GitHub Desktop.
angular.module('app').config(function ($provide) {
$provide.provider('myService', function () {
var config;
return {
setConfig: function (_config) {
config = _config;
},
$get: function (otherService) {
// use config in here
}
}
})
}).config(function (myServiceProvider) {
myServiceProvider.setConfig({
color: 'blue'
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment