Skip to content

Commit

Permalink
Render all contacts in contacts view
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytroyarmak committed Feb 3, 2014
1 parent 9c01c24 commit 1156a55
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/js/views/contacts.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
ContactManager.Views.Contacts = Backbone.View.extend({
template: _.template($('#tpl-contacts').html()),

renderOne: function(contact) {
var itemView = new ContactManager.Views.Contact({model: contact});
this.$('.contacts-container').append(itemView.render().$el);
},

render: function() {
var html = this.template();
this.$el.html(html);

this.collection.each(this.renderOne, this);

return this;
}
});

0 comments on commit 1156a55

Please sign in to comment.