Last active
December 17, 2015 23:38
-
-
Save ultim8k/5690218 to your computer and use it in GitHub Desktop.
A simple javascript app template :)
This file contains hidden or 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
/** | |
* A simple javascript app template; | |
*/ | |
// assuming your app is called app | |
var app = { | |
settings: { | |
example : true, | |
example2: '' | |
}, | |
myfunction: function(){ | |
var self = this; | |
var s = self.settings; | |
console.log(s.example2); | |
}, | |
init: function(ex2){ | |
var self = this; | |
var s = self.settings; | |
if (ex2){ | |
s.example2 = ex2; | |
} | |
} | |
}; | |
// Then you call the app functions: | |
app.init('test'); | |
app.myfunction(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment