Search code examples
javascriptbackbone.jsmodel-view-controllermarionette

Typical ways to load backend data into Backbone Models


I'm working on a production app using Backbone Marionette. We have several different Views and Models associated with them. We also have several Controller classes which invoke and create the Views and Models. However, what is the best practice for loading in the backend data and using that data to populate the model? Is the typical process to create a blank model instance and then make an AJAX call to the backend to fill the model in? I'm interested in learning more about how people using Backbone and Marionette typically load data from their backend.


Solution

  • Backbone Docs say that it is better to have your Models and Collections pre populated with data from backend. See Loading Bootstrapped Models.