title: Handlebars Using @root in Custom Helper
body: <p>I have a scenario where I am trying to access a separate element in my custom helper from within a nested for loop. When I use root outside my for loop I don't have any issues, but I can't seem to use <code>@root</code> within my custom helper. I thought maybe <code>../</code> would work, but it appears that is only be moving up to the parent element, not a one that is separate</p>
  
  <p><strong>Here are my two objects:</strong></p>
  
  <pre><code>category //Object being looped through
  categoryQuery //Query object being compared to looped values
  </code></pre>
  
  <p><strong>Here is my view (looping through ID's and then apply selected to the ID attached to categoryQuery:</strong></p>
  
  <pre><code>{{#category}}
     &lt;option value="{{this.categoryId}}"{{selected this.categoryId @root.categoryQuery}}&gt;{{this.categoryName}}&lt;/option&gt;
  {{/category}}
  </code></pre>
  
  <p><strong>Preselected value if the values match:</strong></p>
  
  <pre><code>/Preselect option value that is associated with edited record
      hbs.registerHelper('selected', function(option, value){
          if (option === value) {
              return 'selected';
          } else {
              return '';
          }
      });
  </code></pre>
  
  <p><strong>Updated:</strong> </p>
  
  <p>when adding <code>console.log('Option : ' + option + ' Value : ' + value);</code> into the <code>else</code> statement of my registered helper, I receive the following, which shows that it isn't an issue that <code>@root.category</code> isn't pulling in the value, but it isn't equating correctly. </p>
  
  <p><strong>For example:</strong></p>
  
  <pre><code>Option : 1 Value : 2
  Option : 2 Value : 2
  Option : 1 Value : undefined
  </code></pre>