我想知道为什么以下不起作用:
咖啡脚本:
post =
title: 'Hello World',
post: 'Hi there it is me',
comments: [
name: 'John',
text: 'That rules'
,
name: 'Arnold',
text: 'Great post!',
tags: ['a', 'b', 'c']
]
directives =
tags:
tag:
text: (target) -> this.value
$('.container').render post, directives
模板:
<div class="container">
<h1 class="title"></h1>
<p class="post"></p>
<div class="comments">
<div class="comment">
<span class="name"></span>
<span class="text"></span>
<div class="tags">
<span class='tag'></span>
</div>
</div>
</div>
</div>
它不会渲染嵌套的普通标签,也不会为它们执行指令函数
有任何想法吗?