Created
January 21, 2013 20:48
-
-
Save jeremywrowe/4589210 to your computer and use it in GitHub Desktop.
Controller Inheritance, Ember, and me.
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
RoflCopter.ApplicationController = Ember.Controller.extend({ | |
sharedBehavior: function() { | |
return "A winner is you!!!"; | |
}.property() | |
}); | |
RolfCopter.AnotherController = RoflCopter.ApplicationController.extend({ | |
importantStuff: function() { | |
var ohBeehave = this.get("sharedBehavior"); | |
if(ohBeehave) { | |
alert(ohBeehave); | |
} else { | |
alert("FML"); | |
} | |
}.property("sharedBehavior") | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I understand that this same thing can be achieved with 'needs' but this seems counter intuitive that this does not work to me.