vamsi kr
vamsi kr

Reputation: 421

Meteor each loop data not displaying

In each loop data is not displaying.value="{{param_type}}" not displaying.Please help me.

{{ #each api_method_param_data }}
    <select id="param_type"> 
    {{#each dropdown}}
    {{#if isSelected this param_type}}  
    <option value="{{param_type}}" selected="selected"> {{this}} </option>
    {{else}}
    <option value="{{param_type}}" > {{this}} </option>
    {{/if}}
    {{/each}}
    </select>
 {{/each}}

This is the helper function

 Template.apimethodchange.isSelected = function(fooToCheck, recordFoo)
  {
    var checkrec = "";  
    for(var i=0;i<recordFoo.length;i++)
    {
        checkrec = checkrec + recordFoo[i];
    }
    console.log(checkrec + fooToCheck);
    return (fooToCheck == checkrec);
  };

Template.apimethodchange.dropdown = ["string","array","int","boolean","double","struct"];

Upvotes: 0

Views: 126

Answers (1)

Steffo
Steffo

Reputation: 622

Try with ../ to access parent context

<option value="{{../param_type}}" selected="selected"> {{this}} </option>

Upvotes: 1

Related Questions