Created
December 19, 2017 07:30
-
-
Save preist/3b4ee0948e1e7175e3831a8ca6b55b44 to your computer and use it in GitHub Desktop.
Backbone model defaults in TypeScript
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
| // Simpler Backbone model defaults in TypeScript | |
| export class Person extends Backbone.Model { | |
| constructor(options?: any) { | |
| var defaults = { | |
| name: 'Nameless', | |
| occupation: 'Unemployed' | |
| } | |
| super(_.defaults(options, defaults)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment