Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@travischoma travischoma commented Feb 21, 2014

Feel free to suggest improvements!

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