eneko/mooml — pull request #6 by squidfunk (2012-03-03 13:36:07+00:00)
Title: Added ability to render multiple templates on same element

Hi eneko,

Mooml looks really great, I enjoy it a lot. However, if I am rendering multiple nested templates, I have to do this (code is in coffeescript):

Mooml.register 'parent-template', (items) ->
dl {}, items.map (item) ->
[ Mooml.render(['partial1'], item), Mooml.render(['partial2'], item), ... ]

This is the case, when you have a very modular template structure and want to compose a view/template for one item of multiple partials. I added 4 lines of code and now you can do this:

Mooml.register 'parent-template', (items) ->
dl {}, items.map (item) ->
Mooml.render(['partial1', 'partial2', ...], item)

I hope you find it useful. Keep up the good work!

Best regards,
Martin