Your problem is how you fill in yours ConnectionsView el. You do it:
// Load the compiled HTML into the Backbone "el"
$(this.el).html(template({
connectionsList: $connections.outer()
}));
, .outer(), . , Underscore template(), , , . DOM $connections , .
:
http://jsfiddle.net/ambiguous/4tjTm/
:
var $connections = $('<div>');
var conn = new ConnectionView({ model: m });
$connections.append(conn.el);
var template = _.template('<%= connectionsList %>');
$('#view-goes-here').append(template({
connectionsList: $connections.html()
}));
ConnectionView . , template() , DOM, . , $connections :
http://jsfiddle.net/ambiguous/AKkCJ/
- :
var $connections = $('<div>');
var conn = new ConnectionView({ model: m });
$connections.append(conn.el);
$('#view-goes-here').append($connections);
.
, , . ? , , - ConnectionsView, $connections DOM - :
render: function() {
var template = _.template($("#connections-template").html());
this.$el.html(template());
var $external = this.$el.find('.external-accounts');
this.collection.each(function (model) {
var conn = new ConnectionView({model: model});
$external.append(conn.el);
});
return this;
}
<div class="external-accounts"> ConnectionsView ConnectionView . , DOM, , DOM .