I\'m trying to fetch a collection from a JSON url. The backbone does send the request and does get a response but there are no models in the collection after it
models
fetchis asynchronous. Try
fetch
stores.fetch({ success:function() { console.log(stores.toJSON()); } });
or
stores.on("sync", function() { console.log(stores.toJSON()); }); stores.fetch();
stores.fetch().then(function() { console.log(stores.toJSON()); });