Skip to content

Instantly share code, notes, and snippets.

@jbueza
Created January 3, 2012 07:39
Show Gist options
  • Save jbueza/1553949 to your computer and use it in GitHub Desktop.
Save jbueza/1553949 to your computer and use it in GitHub Desktop.
Cleaner way of writing Mojo Controllers
mojo.define("resaas.controller.LoginController", function() {
var $ = jQuery;
var LoginController = {
events: [], methods: {}
};
return LoginController;
});
@jbueza
Copy link
Author

jbueza commented Jan 3, 2012

I am thinking about changing it so that jQuery automatically gets passed into the function like this -- We've been running into a lot of repetitive things like re-declaring $ as jQuery since there's double MooTools action going on.

mojo.define("resaas.controller.LoginController", function($) {

  var LoginController = {
    events: [], methods: {}
  };

  return LoginController;
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment