0
如果我先從以下內容:如何將html添加到emberjs模板?
<script type="text/x-handlebars" id="Parent">
<p>Name: {{input type="text" value=name}}</p>
<button {{action 'addChild'}}>Add Child</button>
</script>
我想按一下按鈕,產生如下:
<script type="text/x-handlebars" id="Parent">
<p>Name: {{input type="text" value=name}}</p>
<p>Child1 Name: {{input type="text" value=child1_name}}</p>
...
...
...
<p>Childn Name: {{input type="text" value=childn_name}}</p>
<button {{action 'addChild'}}>Add Child</button>
</script>
感謝。
感謝傑米!我的代碼開始看起來像你想出的,但我將改變我的代碼以符合你的解決方案。 – user2517182 2015-03-09 21:45:15