Created
November 13, 2013 20:08
-
-
Save sorensen/7455508 to your computer and use it in GitHub Desktop.
Backbone constructor override.
This file contains 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
;['View' | |
, 'Model' | |
, 'Collection' | |
, 'Router' | |
].forEach(function(klass) { | |
var original = Backbone[klass] | |
Backbone[klass] = original.extend({ | |
constructor: function() { | |
// Custom logic here... | |
return original.apply(this, arguments); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment