Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use partial templates with map in StringTemplate?

I've got a map of city names => distance-from-origin.

I'd like to use a partial with this map, and create something like so:

<ul>
<li>city1: distance1</li>
<li>city2: distance2</li>
<li>city3: distance3</li>
</ul>

What is the canonical way to do this with StringTemplate?

Thanks.

like image 343
Alex Baranosky Avatar asked Nov 20 '25 20:11

Alex Baranosky


1 Answers

<ul>
$amap.keys:{k | <li>$k$: $amap.(k)$</li>}$
</ul>
like image 81
Terence Parr Avatar answered Nov 24 '25 22:11

Terence Parr