1 回答

TA贡献1828条经验 获得超4个赞
在第 45 行,调用后有一个额外的右括号comment.author.id.equals(currentUser._id)。
<% if(currentUser && comment.author.id.equals(currentUser._id)) || currentUser && currentUser.isAdmin){ %>
<!-- ^^^^ -->
<a class="btn btn-xs btn-warning"
href="/components/<%= component._id %>/comments/<%= comment._id %>/edit">Edit</a>
<form class="delete-form" action="/components/<%= component._id %>/comments/<%= comment._id %>?_method=DELETE" method="post">
<input type="submit" class="btn btn-xs btn-danger" value="Delete">
</form>
</div>
<% } %>
错误消息还建议使用ejs-lint来获取更多有用的错误消息。我建议尝试一下。在这种情况下,它打印:
Unexpected token (45:81) in test.ejs
添加回答
举报