Skip to content

Instantly share code, notes, and snippets.

@tonylukasavage
Created August 3, 2012 15:16
Show Gist options
  • Save tonylukasavage/3248559 to your computer and use it in GitHub Desktop.
Save tonylukasavage/3248559 to your computer and use it in GitHub Desktop.
module.exports = Alloy.getController('BaseController').extend({
customFunction: function(){ alert('inherited function call!'); }
});
module.exports = Alloy.getController('A').extend({
preLayout: function(args) { // OPTIONAL
// do stuff before the view hierarchy is created, like update styles with runtime values
// or execute the parent controller's constructor
// Alloy.getController('A').call(this, args);
},
postLayout: function(args) { // OPTIONAL
// do stuff after the view hierarchy is created
}
});
module.exports = Alloy.getController('BaseController').extend({
postLayout: function(args) {
var B = Alloy.getController('B');
var instance = new B();
instance.customFunction(); // makes function call defined in A.js
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment