Created
August 3, 2012 13:24
-
-
Save tonylukasavage/3247683 to your computer and use it in GitHub Desktop.
no magic controllers
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
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