Skip to content

Instantly share code, notes, and snippets.

@preist
Created December 19, 2017 07:30
Show Gist options
  • Save preist/3b4ee0948e1e7175e3831a8ca6b55b44 to your computer and use it in GitHub Desktop.
Save preist/3b4ee0948e1e7175e3831a8ca6b55b44 to your computer and use it in GitHub Desktop.
Backbone model defaults in TypeScript
// 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