title: jquery tmpl inside each
body: <p>I have a set of templates iterating via {{each}} statement.
  Code is like</p>
  
  <pre><code>    &lt;script id="inTmpl" type="text/x-jquery-tmpl"&gt;
           ${sub.title}
      &lt;/script&gt;
      &lt;script id="outTmpl" type="text/x-jquery-tmpl"&gt;
           &lt;div&gt;
           {{each(i, sub) parent}}
                ${sub.title}
                {{tmpl "#inTmpl"}}
           {{/each}}
           &lt;/div&gt;
      &lt;/script&gt;
      &lt;script type="text/javascript"&gt;
            $(function() {
                 $("#outTmpl").tmpl({
                      "parent": [
                          {"title": "a"},
                          {"title": "b"}
                      ]
                 }).appendTo("body");
            });
      &lt;/script&gt;
  </code></pre>
  
  <p>Then I get error: "Uncaught ReferenceError: sub is not defined". Why?!</p>