Accessing Array from repeat in Polymer -
if have template-repeat tag this:
<template id="t" repeat="{{i in outputfields}}"> {{i.name}} <template ref="t" repeat="{{i in i.childoutputfields }}"></template> </template>
i able acccess current array in template iterating on can add this:
<template if="{{i != currentarray[currentarray.length-1] }}"> ,</template>
where currentarray array template iterating over.
is there way array being iterated over?
polymer supports array indexing in template repeat so:
<template repeat="{{item, in items}}"> {{item}}<span hidden?="{{i == items.length - 1}}">,</span> </template>
Comments
Post a Comment