dustjs icon indicating copy to clipboard operation
dustjs copied to clipboard

Problem accessing outer AND inner indexes inside nested arrays at the same time

Open RaDangelo opened this issue 7 years ago • 0 comments

Hi, I've got nested arrays such as this one:

"outer" : [ { "inner": [ {}, {} ] }, { "inner": [ {}, {} ] } ]

I neeed to generate an output like that one:

outer[0].inner[0] outer[0].inner[1] outer[1].inner[0] outer[1].inner[1]

My problem is that once I'm inside the inner context, I do not know the outer index. $idx gives me the index of inner. Is there a way for me to access the outer index inside the inner context?

Template example: {#outer} {#inner} outer[???].inner[{$idx}] {/inner} {/outer}

RaDangelo avatar May 07 '18 04:05 RaDangelo