Created
September 8, 2015 16:22
-
-
Save foleyatwork/a8148651dff28b3b9987 to your computer and use it in GitHub Desktop.
An example of the old way of creating controllers.
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
/* | |
* This way of creating a controller has a few issue: | |
* 1. It buries the namespace declaration at the bottom of the document. | |
* 2. It creates an unnecessary abstraction of the namespace that may not be obvious to developers. | |
* 3. It requires retyping the namespace in every single file. | |
*/ | |
(function(exports) { | |
var HelloWorld = function() { | |
console.log('Hello, World!'); | |
} | |
exports.HelloWorld = HelloWorld. | |
}(window.Site.Controllers)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment