I can't figure it out (I'm sure I was thinking or not thinking here) to get the length of the array in the following example. Can someone help me or direct me to a good tutorial. https://github.com/linkedin/dustjs/wiki/Dust-Tutorial mentioned the {@size} helper, but has no examples.
<ul total-tems={#items.length/}> {#items} <li class="item-{$idx}">{.title}</li> {/items} </ul>
Thanks in advance.
Yes, I obviously didnβt notice. I did not turn on (require ("assistant vacuum cleaners");) to use
<ul total-tems="{@size key=items /}">
Hope this helps others too.
I don't know if this is a new dustjs feature, but now you can just use {items.length} to access the length of the array without the need for helpers.
{items.length}
Source: https://habr.com/ru/post/1468764/More articles:Pagination with Elasticsearch, Tire, and Kaminari - ruby-on-railsAdd new entry to plone.registry without restarting GenericSetup / reinstalling product - plonehttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1468761/prevent-opencsv-from-writing-quotes-to-csv-file&usg=ALkJrhiVbFEpeqk3o9e-vEkM9FRYMIVbiwHow to set a dynamic route for using slug in CodeIgniter? - phpCodeigniter: checking two fields - codeigniterIsolating a scope but maintaining binding to ngModel - javascriptapplying the path only along the execution path - compiler-constructionFind max and min DateTime in Linq group - c #CFG generation for all source code with LLVM - llvmTools for a good web development environment on Chrome OS - google-chromeAll Articles