mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #2477 from dsuket/master
fixed bug. change Collection.collection to Model.collection
This commit is contained in:
@@ -140,6 +140,14 @@ function test_collection() {
|
||||
var alphabetical = books.sortBy((book: Book): number => {
|
||||
return null;
|
||||
});
|
||||
|
||||
var model: Book = new Book({title: "Test", author: "Mike"});
|
||||
books.add(model);
|
||||
var model2: Book = model.collection.first();
|
||||
if (model !== model2) {
|
||||
throw new Error("Error");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//////////
|
||||
|
||||
Vendored
+2
-1
@@ -95,6 +95,8 @@ declare module Backbone {
|
||||
attributes: any;
|
||||
changed: any[];
|
||||
cid: string;
|
||||
collection: Collection<any>;
|
||||
|
||||
/**
|
||||
* Default attributes for the model. It can be an object hash or a method returning an object hash.
|
||||
* For assigning an object hash, do it like this: this.defaults = <any>{ attribute: value, ... };
|
||||
@@ -156,7 +158,6 @@ declare module Backbone {
|
||||
//model: typeof TModel;
|
||||
model: { new(): TModel; }; // workaround
|
||||
models: TModel[];
|
||||
collection: TModel;
|
||||
length: number;
|
||||
|
||||
constructor(models?: TModel[], options?: any);
|
||||
|
||||
Reference in New Issue
Block a user