Created
February 21, 2014 03:56
-
-
Save travischoma/9128466 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feel free to suggest improvements!