Javascript 获取每个把手的父循环索引
这是我的结构Javascript 获取每个把手的父循环索引,javascript,ember.js,handlebars.js,template-engine,helper,Javascript,Ember.js,Handlebars.js,Template Engine,Helper,这是我的结构 {{#each a in aa}} {{_view.contentIndex}} --> PARENT {{#each a in aa}} {{_view.contentIndex}} --> This should be the same PARENT val {{/each}} {{/each}} 问题是,在第二个循环中,我得到了当前范围的值,我需要得到父范围,在ember/Handlebar中有没有办法得到这个值?如果我理解正确,
{{#each a in aa}}
{{_view.contentIndex}} --> PARENT
{{#each a in aa}}
{{_view.contentIndex}} --> This should be the same PARENT val
{{/each}}
{{/each}}
问题是,在第二个循环中,我得到了当前范围的值,我需要得到父范围,在ember/Handlebar中有没有办法得到这个值?如果我理解正确,您应该能够做到:
{{#each parent}}
{{_view.contentIndex}} --> PARENT
{{#with parent}}
{{#each otherThing}}
{{_view.contentIndex}} This should be the same PARENT val
{{/each}}
{{/with}}
{{/each}}
最外层的循环将是父项
使用{{with}}的内部循环应该在每个单独父项内的每个项之间循环。的可能重复项