Chr*_*ris 6 javascript backbone.js underscore.js
我正在使用Backbone.js,Underscore.js,HAML和Coffeescript构建应用程序.
我遇到的问题是在html元素属性中插入变量.
<% _.each(collection.models, function(document) { %>
%tr
%td
%input{:type => 'checkbox', :name => "documents[]", :value => "<%= document.attributes.id %>"}
%td <%= document.attributes.id %>
%td <%= document.attributes.name %>
<% } %>
<% }); %>
Run Code Online (Sandbox Code Playgroud)
对象的值正在显示内部<td>,但不在输入的value属性内.
是否可以在元素属性内插值?我无法找到解决方案.
谢谢
| 归档时间: |
|
| 查看次数: |
1979 次 |
| 最近记录: |