【发布时间】:2014-06-15 09:52:52
【问题描述】:
我在Marionette 中有这个ItemView:
App.View.MovieListItem = Marionette.ItemView.extend({
tagName: 'li',
className: 'movie',
model: App.Model.Movie,
id: function() {
return 'movie-'+this.model.get('imdb')
},
initialize: function () {
this.render();
},
template: _.template('<a href="javascript:;">'+
'<i class="fa fa-eye fa-3"></i>'+
'<span class="cover"></span>'+
'<strong><%= title %></strong>'+
'<small><%- year %></small>'+
'<small2>Cached</small2>'+
'</a>'),
});
我想知道是否可以动态创建模板?
因为有一段时间我想(基于检查某事的方法)删除small2 标签。
【问题讨论】:
标签: javascript html backbone.js marionette