Created
June 6, 2013 09:19
-
-
Save fiznool/5720342 to your computer and use it in GitHub Desktop.
Overriding Backbone Constructor.
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
Backbone.View.extend({ | |
constructor: function (options) { | |
// Do stuff before the View has been setup | |
Backbone.View.apply(this, arguments); | |
// Do stuff after the View has been setup, | |
// particularly after `initialize()` has been called | |
return this; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
also technically this is just extending the constructor, you are not overriding it because you are calling the original constructor