Skip to content

Instantly share code, notes, and snippets.

@martianyi
Last active August 2, 2017 01:48
Show Gist options
  • Save martianyi/9aa11f1ea0f29025fd0b to your computer and use it in GitHub Desktop.
Save martianyi/9aa11f1ea0f29025fd0b to your computer and use it in GitHub Desktop.
angularjs service to share properties between functions
//share properties between functions
angular
.module('app', [])
.service('sharedProperties', function () {
var hashtable = {};
return {
setValue: function (key, value) {
hashtable[key] = value;
},
getValue: function (key) {
return hashtable[key];
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment