Created
September 4, 2011 04:51
-
-
Save jbueza/1192286 to your computer and use it in GitHub Desktop.
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
| mojo.require("app.extensions.SomeLibrary"); //I am against this as we should always | |
| //package all extensions during deployment | |
| /* | |
| * @class Registration Controller | |
| * @author Jaime Bueza | |
| * @context #registration-form | |
| */ | |
| mojo.define("app.controller.RegistrationController", { | |
| addObservers: function() { | |
| }, | |
| addCommands: function() { | |
| }, | |
| addIntercepts: function() { | |
| } | |
| }); | |
| mojo.define = function define(name, definition) { | |
| //by convention, do not allow custom controllers inheriting from custom controllers | |
| var mojoClassType = function(type) { | |
| if ( type.match(/Controller/gi) ) return mojo.controller.Controller; | |
| if ( type.match(/Command/gi) ) return mojo.command.Command; | |
| if ( type.match(/Behavior/gi) ) return mojo.command.Behavior; | |
| }(name); | |
| mojo.provide(name); | |
| mojo.declare(name, mojoClassType, definition); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment