Skip to content

Instantly share code, notes, and snippets.

@tonylukasavage
Created August 3, 2012 13:24
Show Gist options
  • Save tonylukasavage/3247683 to your computer and use it in GitHub Desktop.
Save tonylukasavage/3247683 to your computer and use it in GitHub Desktop.
no magic controllers
module.exports = Alloy.getController('BaseController').extend({
// rarely used
preLayout: function(args){},
// where 98% of the code will go
postLayout: function(args) {
$.label.text = 'here i am';
// other controller code
},
// We can now easily and clearly extend the controller class
someOtherCustomFunction: function() {},
customProperty: 12345
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment