Batman.js is no longer in production at Shopify and is not actively maintained.

This website is left for reference (and for old times' sake).


Batman.IteratorView extends Batman.View. It is instantiated by data-foreach bindings.

By default, Batman.IteratorView wraps elements in a plain Batman.View, but you can provide a custom view for each item by putting a data-view binding on the node with the data-foreach binding.

For example:

  <li data-foreach-item='collection' data-view='ItemListingView'>
    <!-- Will use App.ItemListingView -->

Help us improve our documentation!

Contributions to this page are welcome on Github. If you find a problem but you cannot fix it, please open an issue.

Discussion regarding batman.js documentation is also welcome on our mailing list.