Skip to content

Instantly share code, notes, and snippets.

@ultim8k
Last active December 17, 2015 23:38
Show Gist options
  • Save ultim8k/5690218 to your computer and use it in GitHub Desktop.
Save ultim8k/5690218 to your computer and use it in GitHub Desktop.
A simple javascript app template :)
/**
* 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