0
<script id="entry-template" type="text/x-handlebars-template">
<h2>This is the template</h2>
{{ count }} items
</script>
<script type="text/javascript">
var MyNamespace = {};
$(document).ready(function() {
MyNamespace.Recipe = Backbone.View.extend({
tagName: "li",
render: function() {
return this.$el.text("Chicken Chilly");
}
})
MyNamespace.MyTagView = Backbone.View.extend({
initialize: function() {
this.render();
},
render: function() {
var template = Handlebars.compile($("#entry-template").html());
this.$el.html(template);
return this;
},
count: 4
});
var View = new MyNamespace.MyTagView();
$("#content").html(View.el);
});
</script>
我得到的輸出爲0的項目,而不是4項查看沒有得到所需要的輸出
是的好友時,該固定它。謝謝! –