Created
November 4, 2014 16:55
-
-
Save anonymous/3365ed1006d4f382f340 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 App = { | |
myProperty : 'someValue', | |
jqueryVar1 : $('.someClass'), | |
jqueryVar2 : $('.someOtherClass'), | |
jqueryVar3 : $('#id'), | |
myConfig:{ | |
useCaching:true, | |
language: 'en' | |
}, | |
myMethod: function(){ | |
console.log('I can haz functionality?'); | |
}, | |
//output a value based on current configuration | |
myMethod2: function(){ | |
console.log('Caching is:' + (this.myConfig.useCaching)?'enabled':'disabled'); | |
}, | |
}; | |
console.log(App.jqueryVar1); | |
console.log(App.myConfig.useCaching); | |
App.myMethod(); //I can haz functionality | |
App.myMethod2(); //outputs enabled |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment