title: Trying to run a function on an array in a, for loop, using jsrender
body: <p>Trying to convert very complex jQuery template code to jsRender.  I have this each loop in the old code:</p>
  
  <pre><code>&lt;script id = "imagesTemplate" type="text/x-jquery-tmpl"&gt;
      {{each(i,imgUrl) twoAcross_filterOutMainImages(OfferGroup.Images)}}
          &lt;img src="{{= imgUrl}}" /&gt;
      {{/each}}
  &lt;/script&gt;
  
  &lt;script id = "largeTemplate" type="text/x-jquery-tmpl"&gt;
      {{tmpl "#imagesTemplate"}}
  &lt;/script&gt;
  
  &lt;div id="LARGE"  class="mainContent"&gt;&lt;/div&gt;
  &lt;script&gt;
       currentOffer = offerGroups[0].Groups[0];
       $( "#LARGE" ).html( $( "#largeTemplate" ).render( currentOffer ) ); 
  &lt;/script&gt;
  </code></pre>
  
  <p>I have edited it to look like this:
      <br>
              
      </p>
  
  <pre><code>{{for ~filterOutMainImages(Images) tmpl="#imagesTemplate"/}}
  
  &lt;div id="LARGE"  class="mainContent"&gt;&lt;/div&gt;
  &lt;script&gt;
       currentOffer = offerGroups[0].Groups[0];
       $( "#LARGE" ).html( $( "#largeTemplate" ).render( currentOffer ) ); 
  &lt;/script&gt;
  </code></pre>
  
  <p>But it does not work. If I change it to be:</p>
  
  <pre><code>&lt;script id = "imagesTemplate" type="text/x-jquery-tmpl"&gt;    
          &lt;img src="{{= imgUrl}}" /&gt;
  &lt;/script&gt;
  
  &lt;script id = "largeTemplate" type="text/x-jquery-tmpl"&gt;
      {{for Images tmpl="#imagesTemplate"/}}
  &lt;/script&gt;
  
  &lt;div id="LARGE"  class="mainContent"&gt;&lt;/div&gt;
  &lt;script&gt;
       currentOffer = offerGroups[0].Groups[0];
        $( "#LARGE" ).html( $( "#largeTemplate" ).render( currentOffer ) ); 
  &lt;/script&gt;
  </code></pre>
  
  <p>It draws the images to display but the function does not run on the image array. But if I leave the Images array without being wrapped in a function and move the for loop to inside the template it breaks.</p>
  
  <p>How would I convert this scenario? </p>