Normal Template reduce-join

2 views
Skip to first unread message

George Moschovitis

unread,
Aug 13, 2010, 1:55:48 AM8/13/10
to nitro-devel
I just added a new, useful feature in normal-template. From the
updated docs (http://www.nitrojs.org/normal-template):

Optionally you can provide the separator string used to join the
collection items

data = {
tags: [
{ label: "Technology" },
{ label: "Programming" }
]
}

{:reduce tags ", "}
{=label}
{/:reduce}
output:

Technology, Programming

I am sure you will find this extra option quite useful. Thanks to
Michael Mathews for the inspiration.

If you have more ideas regarding normal-template, let me know!

regards,
George.
Reply all
Reply to author
Forward
0 new messages