// Template Helper
window.template = function (id) {
return _.template($('#' + id).html());
};
// Template Helper in view.render
this.$el.html( this.template(this.model.toJSON()) );
// This Template Call in View
template: template('response-form')
// This My If Else Construction in View Initialize
if (this.model.attributes.status === true) {
here i want set template id to response-auth
} else {
here i want set template id to response-form
}
我不知道,如何动态更改模板调用的值?有人可以帮助我吗?