there are some data:
var data = [
{id:"a",b:[{name:"1",value:"a"},{name:"2",value:"x"}],c:"a"}
{id:"b",b:[{name:"2",value:"b"},{name:"3",value:"c"}],c:"b"}
]
and in the Template
...
{{#each data}}
{{id}}
select>
{{#each b}}
option {{#if equal value c}} selected {{/if}} >
name
option>
{{/each}}
{{/each}}
..
The function:
Template.temp.equal = function(value,test){
console.log(value);
console.log(test);
}
and the "test" is undefined,In other words,In the second #each can't read the value of the First #each . What's the step I have forgotten? how can I get the value of property "c" in second #each ?