Skip to content

Instantly share code, notes, and snippets.

@jamesarosen
Created January 24, 2014 17:41
Show Gist options
  • Select an option

  • Save jamesarosen/8602251 to your computer and use it in GitHub Desktop.

Select an option

Save jamesarosen/8602251 to your computer and use it in GitHub Desktop.
Overriding observed functions in Ember 1

What is the expected behavior of the following code?

var Superclass = Ember.Object.extend({
  logOnInit: function() {
    console.log('Superclass#logOnInit');
  }.on('init')
});

var Subclass = Superclass.extend({
  logOnInit: function() {
    console.log('Subclass#logOnInit');
    this._super();
  }.on('init')
});

Subclass.create();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment