html5 - jquery template array inside of array -
i've json object this
[object] 0: object domains: array[1] 0: "domain1.com" length: 1 __proto__: array[0] name: "name1" 1: object domains: array[2] 0: "domain2.com" length: 1 __proto__: array[0] name: "name2"
these objects generated on client , want display them using jquery.tmpl plugin. i've defined template be:
<script id="domain_template" type="text/x-jquery-tmpl"> {{each response}} {{each response.domains}} <div class="dummy_copy" data-srvtype="${srvtype}" data-domain="${domain}">"${value}"</div> {{/each}} {{/each}} </script>
what did wrong here? thanks
you're code should be:
{{each response}} {{each $value.domains}}
or
{{each response}} {{each domains}}
and if wont have values: srvtype, domain, value must members of objects store in domains
Comments
Post a Comment