Handlebar:从子范围访问父范围

时间:2017-03-04 09:19:47

标签: javascript ruby-on-rails handlebars.js

以下是Object我传递给handlebar

{
    "parent_scope_name": "Parent Scope",
    "parent_scope_id": "240", 
    "child_terms": [
        {
            "value": "some random value",
            "id": "19512",
        }
    ]
}

所以,我在下面做:

{{#each child_terms}}
      <p>child term value::{{value}}</p>
      <p>child term id  :: {{id}}</p>
      <p>Now the next line I need to get parent scope name which is in parent scope. I tried as below. does not work</p>
      <p>{{../parent_scope_name}}</p>
{{/each}}

请告诉我如何从子词语境中访问parent_scope_name

由于

0 个答案:

没有答案