Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 'subModelTypes' in a Relational Model #494

Open
jbsouvestre opened this issue Oct 1, 2014 · 0 comments
Open

Use 'subModelTypes' in a Relational Model #494

jbsouvestre opened this issue Oct 1, 2014 · 0 comments
Labels

Comments

@jbsouvestre
Copy link

Hi,

I would like to know if the use case presented in this jsfiddle is possible with Backbone Relational

http://jsfiddle.net/fe0wkws8/2/

In this example, I would like Zoo to have a collection of Primate, Primate being an abstract model of Chimp and Gorilla.
I would like those models to be constructed only when calling fetchRelated on Zoo.

It appears that the models are being initialised when instantiating the Zoo abjet, and therefore only creating Primate objects (because it doesn't have a type field at the moment).
Is there a way to instantiate the models only after the fetchRelated is called ? Is this a use case for createModels ?

Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants