Skip to content

Instantly share code, notes, and snippets.

@tanqhnguyen
Created June 6, 2012 16:34
Show Gist options
  • Save tanqhnguyen/2883107 to your computer and use it in GitHub Desktop.
Save tanqhnguyen/2883107 to your computer and use it in GitHub Desktop.
var BaseView = Backbone.View.extend({
someMethod: function() {
console.info("super");
}
});
var MyView = BaseView.extend({
someMethod: function() {
// call this method from parent
MyView.prototype.someMethod.call(this);
console.info("child");
}
});
var myView = new MyView();
myView.someMethod(); // the output will be super and then child
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment