2
{{each}} 문장을 통해 반복되는 템플릿 집합이 있습니다. jquery tmpl within each
<script id="inTmpl" type="text/x-jquery-tmpl">
${sub.title}
</script>
<script id="outTmpl" type="text/x-jquery-tmpl">
<div>
{{each(i, sub) parent}}
${sub.title}
{{tmpl "#inTmpl"}}
{{/each}}
</div>
</script>
<script type="text/javascript">
$(function() {
$("#outTmpl").tmpl({
"parent": [
{"title": "a"},
{"title": "b"}
]
}).appendTo("body");
});
</script>
그럼 내가 오류 같은 코드는 다음과 같습니다 "catch되지 않은 ReferenceError가 : 서브가 정의되어 있지 않습니다." 왜?!