var Home = Backbone.View.extend({
template: _.template($('#home-template').html()),
initialize: function (params) {
this.collection = new BlogList();
this.listenTo(this.collection, "add", this.renderBlog);
this.listenTo(this.collection, "reset", this.render);
},
render: function() {
this.$el.html(this.template({hasPrevious: this.collection.hasPrevious()}));
this.collection.each(function(item) {
this.renderBlog(item);
}, this);
return this;
},
renderBlog: function(item) {
this.$('#blog-list-container').append((new BlogPreView({ model: item })).render().el);
},
BlogPreView является Backbone.View Новый BlogPreView инстанциируется много раз. Нужно ли мне удалять старые.Должен ли я удалить неиспользуемые представления на Backbone.js
Как удалить backbone.view и как удалить этот конкретный пример?