Skip to content

Instantly share code, notes, and snippets.

@travischoma
Created February 21, 2014 03:56
Show Gist options
  • Save travischoma/9128466 to your computer and use it in GitHub Desktop.
Save travischoma/9128466 to your computer and use it in GitHub Desktop.
var constants = {
settings: {
setting1: "value1",
setting2: "value2",
setting3: "value3"
}
};
// check if we are in a Node enviro
if( typeof module != 'undefined') {
module.exports = constants;
// check if we are in an Angular enviro
} else if( typeof angular != 'undefined') {
angular.module('myApp')
.constant('constants',constants);
}
@travischoma
Copy link
Author

Feel free to suggest improvements!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment