Skip to content

Instantly share code, notes, and snippets.

@jmfayard
Created February 27, 2017 09:00
Show Gist options
  • Save jmfayard/5dba4e5d3974b0513c23e1e8e3ad2496 to your computer and use it in GitHub Desktop.
Save jmfayard/5dba4e5d3974b0513c23e1e8e3ad2496 to your computer and use it in GitHub Desktop.
Bacbone : old & new
define([
"underscore",
"backbone",
"util",
"modules/views/customerprofile"
], function (_, Backbone, util, CustomerProfile) {
return Backbone.View.extend(
{
initialize: function (options) {
// what the fuck is options here?
},
}
)
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