I am trying to achieve this in JsRender. As You can see from the code below, SubMenuItems and SubMenuPages are child objects in a array of objects.However, I would like to compare a value in the first Object with a value in the second respectively.I have only qualified the if condition just so it is clear what I'm trying to accomplish.
So basically I would like to access an id variable in one child object and then check against another variable in another object. I am a bit unsure as to the syntax regarding this , since all i tried kept returning nothing.
{{for SubMenuItems}}
<li><a href="#">{{>Name}}</a></li>
<ul>
{{for SubMenuPages}}
{{if SubMenuItems.PageMenuId == SubMenuPages.Id }}
<li><a href="{{>PageUrl}}" >{{PageName}}</a></li>
{{/if}}
{{/for}}
{{/for}}
</ul>