<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[jsrender &#x2F; components : passing extra attributes]]></title><description><![CDATA[<p>Hello,<br />
How do you pass extra attributes to components using jsrender ?<br />
I have tried this but I get &quot;Unmatched or missing {{/prepareData}}, in template:&quot;</p>
<pre><code>{{:~prepareData(@root.name)}}
  {{:~component(&quot;./compo&quot;)}}
{{/prepareData}}
</code></pre>
<p>My prepareData function is declared like this:</p>
<pre><code>function prepareData(someAttribute, options) {   
    return options.fn({
        ...this,
        someAttribute
    })
}
</code></pre>
<p>Thanks !</p>
]]></description><link>https://forum.jsreport.net/topic/2556/jsrender-components-passing-extra-attributes</link><generator>RSS for Node</generator><lastBuildDate>Fri, 15 May 2026 04:28:32 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/2556.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 06 Sep 2022 02:36:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to jsrender &#x2F; components : passing extra attributes on Invalid Date]]></title><description><![CDATA[<p>Hello,<br />
How do you pass extra attributes to components using jsrender ?<br />
I have tried this but I get &quot;Unmatched or missing {{/prepareData}}, in template:&quot;</p>
<pre><code>{{:~prepareData(@root.name)}}
  {{:~component(&quot;./compo&quot;)}}
{{/prepareData}}
</code></pre>
<p>My prepareData function is declared like this:</p>
<pre><code>function prepareData(someAttribute, options) {   
    return options.fn({
        ...this,
        someAttribute
    })
}
</code></pre>
<p>Thanks !</p>
]]></description><link>https://forum.jsreport.net/post/11106</link><guid isPermaLink="true">https://forum.jsreport.net/post/11106</guid><dc:creator><![CDATA[gosanefr]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to jsrender &#x2F; components : passing extra attributes on Invalid Date]]></title><description><![CDATA[<p><a href="https://playground.jsreport.net/w/anon/ogCgSXL9" rel="nofollow">https://playground.jsreport.net/w/anon/ogCgSXL9</a></p>
<pre><code>{{prepareData &quot;hello&quot;}}
   {{:~component(&quot;./c1&quot;)}}
{{/prepareData}}
</code></pre>
<pre><code>function prepareData(v) {
    return this.tagCtx.render({
        propA: v
    })
}
</code></pre>
]]></description><link>https://forum.jsreport.net/post/11110</link><guid isPermaLink="true">https://forum.jsreport.net/post/11110</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to jsrender &#x2F; components : passing extra attributes on Invalid Date]]></title><description><![CDATA[<p>However, I recommend using mainly handlebars. Some new recipes support just that.</p>
]]></description><link>https://forum.jsreport.net/post/11111</link><guid isPermaLink="true">https://forum.jsreport.net/post/11111</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to jsrender &#x2F; components : passing extra attributes on Invalid Date]]></title><description><![CDATA[<p>Thanks for the quick answer. I will consider going back to Handlebars but the fact that you have to write a function for every single test is really annoying (rather than directly doing something like {{if field&gt;=2}}...{{/if}}). I will create a new thread on the question.</p>
]]></description><link>https://forum.jsreport.net/post/11112</link><guid isPermaLink="true">https://forum.jsreport.net/post/11112</guid><dc:creator><![CDATA[gosanefr]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>