Last active
August 29, 2015 14:19
-
-
Save bendrucker/21f2068f8b77c04b0065 to your computer and use it in GitHub Desktop.
Extend a Bookshelf model and call a parent method
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
| class Child extends Parent { | |
| parse (attributes) { | |
| super.parse(attributes) | |
| return attributes | |
| } | |
| } |
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
| var Child = Parent.extend({ | |
| parse: function (attributes) { | |
| Parent.prototype.parse.call(this, attributes) | |
| return attributes | |
| } | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment