Created
October 18, 2012 21:04
-
-
Save uhtred/3914722 to your computer and use it in GitHub Desktop.
javascript: Controller Pattern
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
/** | |
* 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