Files
DefinitelyTyped/backbone
Frederik Wordenskjold ea103215ea Make it possible to initialize a Backbone.Collection from raw objects
The following syntax is supported in Backbone, but is currently not compileable in Typescript:

    var data = [
      { id: 1, bar: 'foo' },
      { id: 2, bar: 'baz' }
    ];

    var myCollection = new Backbone.Collection(data);

As of now, the constructor expects an array of models. I've added the Object[] parameter type, in addition to the TModel[] type to support this syntax.
2015-07-15 16:20:54 +02:00
..