Skip to content

Instantly share code, notes, and snippets.

@uhtred
Created October 18, 2012 21:04
Show Gist options
  • Save uhtred/3914722 to your computer and use it in GitHub Desktop.
Save uhtred/3914722 to your computer and use it in GitHub Desktop.
javascript: Controller Pattern
/**
* Controller
* @return object
*/
var AppControlerName = (function(){
/**
* Declarations
*/
var variable,
sampleOptionsDefault = {};
/**
* Initialize
* @param object options Optional definitions
*/
function init( options ) {
$(document.body)
.on('click', '.btn', functionName);
}
function sample( options ) {
options = $.extend({}, sampleOptionsDefault, options);
}
/**
* Make public
*/
return {
init: init
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment