The most likely reason you are not seeing the models in your view is because the render is happening before the asynchronous fetch
is complete.
Something like below would work better:
mdm.LinksView = Backbone.View.extend({
el: '#link_list',
initialize: function() {
this.collection = new mdm.Posts();
this.listenTo(this.collection, 'reset', this.render);
this.collection.fetch({reset: true});
}
The above code sets a listener for the reset
event on the collection
and executes the render
function when that happens.
Also, you could passing in success
and error
handlers into fetch
and call the render function manually as well.
this.collection.fetch({
success: _.bind(function() {
this.render(); }, this)
});
Hope this helps!