Skip to content

Instantly share code, notes, and snippets.

@jeremywrowe
Created January 21, 2013 20:48
Show Gist options
  • Select an option

  • Save jeremywrowe/4589210 to your computer and use it in GitHub Desktop.

Select an option

Save jeremywrowe/4589210 to your computer and use it in GitHub Desktop.
Controller Inheritance, Ember, and me.
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")
});
@jeremywrowe

Copy link
Copy Markdown
Author

I understand that this same thing can be achieved with 'needs' but this seems counter intuitive that this does not work to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment