-
-
Save tonylukasavage/3248559 to your computer and use it in GitHub Desktop.
This file contains 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({ | |
customFunction: function(){ alert('inherited function call!'); } | |
}); |
This file contains 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('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 | |
} | |
}); |
This file contains 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({ | |
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