Skip to content

Instantly share code, notes, and snippets.

@jcreamer898
Created June 3, 2015 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcreamer898/875c7628dd9de24ca498 to your computer and use it in GitHub Desktop.
Save jcreamer898/875c7628dd9de24ca498 to your computer and use it in GitHub Desktop.
<div class="parent">
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
</div>
var Child = Backbone.View({
// ...
});
var Parent = Backbone.View({
initialize: function() {
this.$el(".child").each(function(i, el) {
new Child({
el: el
});
});
}
});
var instance = new Parent({
el: ".parent"
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment