Created
June 10, 2017 12:20
-
-
Save GerkinDev/429433c07cb69450ada4619b32cce1b8 to your computer and use it in GitHub Desktop.
Backbone relational
This file contains hidden or 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
var scope = {}; | |
Backbone.Relational.store.addModelScope(scope); | |
scope.Foo = Backbone.RelationalModel.extend(); | |
scope.Bar = Backbone.RelationalModel.extend({ | |
relations: [ | |
{ | |
key:'foo', | |
relatedModel:'Foo', | |
type:'HasOne', | |
reverseRelation:{ | |
key:'bar', | |
includeInJSON:'id', | |
model:'Bar' | |
} | |
} | |
] | |
}); |
This file contains hidden or 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
Relation= Object { instance: null, reverseRelation: Object, options: Object, key: "foo", keySource: "foo", keyDestination: "foo", model: Window → index2.html, relatedModel: n() } : model does not inherit from Backbone.RelationalModel ( null ). backbone-relational.min.js:1:8090 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment