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> 

http://jsbin.com/pagejoga/1/edit


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -