Pese a que el request es ejecutado correctamente, prueba de ello el response exitoso en firebug, el collection sigue en length 0
Por donde le estoy errando?
Código Javascript:
Ver original
var AppView = Backbone.View.extend({ initialize: function() { this.collection = new DestinationModelList(); this.collection.fetch(); this.render(); }, render: function() { console.log(this.collection.length);//0 console.log(this.collection.models);//Array[0] } }); var DestinationModelList = Backbone.Collection.extend({ model: destinationModel, url: 'js/data/destinations.json', parse : function(response){alert('method parse called');//Esto nunca se ejecuta return response.destinations; } }); var destinationModel = Backbone.Model.extend({ defaults: function() { return { title: "empty todo...", order: Todos.nextOrder(), done: false }; }, toggle: function() { this.save({done: !this.get("done")}); } }); //El code dentro del .json { 'destinations' : [ { 'city' : 'Obidos', 'country' : 'Portugal', 'destination airport' : 'LGW', 'departure time' : '5:10PM', 'trip duration' : '4 hours', 'weather' : '32/22', 'price' : '370' }, { 'city' : 'Lisboa', 'country' : 'Portugal', 'destination airport' : 'LGW', 'departure time' : '5:10PM', 'trip duration' : '4 hours', 'weather' : '25/15', 'price' : '370' } ] }