是否可以在提供的标签中添加另一个标签tagName
?
我有这个代码:
BookView = Backbone.View.extend(
tagName: "li"
events:
"click .delete": "deleteBook"
deleteBook: (ev) ->
#delete operation /books/id
@book.destroy success: ->
router.navigate "",
trigger: true
我想把按钮放在每个li
标记名中,所以当有人点击它时,它会删除该记录。我怎么能那样做?
例如:
<ul>
<li>Some text <button type="submit">Delete</button></li>
</ul>