Skip to content

Instantly share code, notes, and snippets.

@vinicius33
Created September 17, 2014 22:03
Show Gist options
  • Save vinicius33/cbe7f40d075cd26a10f8 to your computer and use it in GitHub Desktop.
Save vinicius33/cbe7f40d075cd26a10f8 to your computer and use it in GitHub Desktop.
$global service angularjs
/**
* App Services Module
*/
angular
.module('app.services', [])
.factory('$global', [function () {
this.settings = {
fullScreen: false,
fooProperty: true
};
this.get = function (key) {
return this.settings[key];
};
this.set = function (key, val) {
this.settings[key] = val;
}
this.getSettings = function () {
return this.settings;
}
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment