Created
February 27, 2017 09:00
-
-
Save jmfayard/5dba4e5d3974b0513c23e1e8e3ad2496 to your computer and use it in GitHub Desktop.
Bacbone : old & new
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
define([ | |
"underscore", | |
"backbone", | |
"util", | |
"modules/views/customerprofile" | |
], function (_, Backbone, util, CustomerProfile) { | |
return Backbone.View.extend( | |
{ | |
initialize: function (options) { | |
// what the fuck is options here? | |
}, | |
} | |
) |
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
import {View, Model, ViewOptions} from 'backbone'; | |
import _ from 'underscore'; | |
interface MyModel extends Model { | |
name: string | |
id: number | |
} | |
class MyView extends View<MyModel> { | |
initialize(options?: ViewOptions<MyModel>): void { | |
super.initialize(options); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment