mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #32267 from wazeHQ/backbone-relational-tojson
fix(@types/backbone-relational): Add toJSON options
This commit is contained in:
@@ -74,6 +74,7 @@ paul.get('livesIn'); // === ourHouse
|
||||
// You can control which relations get serialized to JSON, using the 'includeInJSON'
|
||||
// property on a Relation. Also, each object will only get serialized once to prevent loops.
|
||||
alert(JSON.stringify(paul.get('user').toJSON(), null, '\t'));
|
||||
alert(JSON.stringify(paul.get('user').toJSON({ option1: 'value1' }), null, '\t'));
|
||||
// Load occupants 'person-2' and 'person-5', which don't exist yet, from the server
|
||||
ourHouse.fetchRelated('occupants');
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -34,7 +34,7 @@ declare module 'backbone' {
|
||||
|
||||
fetchRelated(key:string, options?:any, update?:boolean):any;
|
||||
|
||||
toJSON():any;
|
||||
toJSON(options?: any):any;
|
||||
|
||||
static setup();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user