1
익숙한 문제가 남아 있지만 혼자 해결할 수 없습니다. 그래서이 문제를 제거하도록 도와주세요. 잡히지 않은 TypeError :보기가 생성자가 아닙니다.
내보기 코드 : 는var LayoutView = Backbone.View.extend({
initialize: function() {
var self = this;
$.get('resources/html/layout.html', function(data) {
self.template = _.template(data);
self.render();
});
},
render: function() {
var self = this;
$(self.el).html(self.template(self.model.toJSON()));
}
});
내 렌더링 코드 :
는$(document).ready(function() {
var LayoutView= new LayoutView({
el:'#wrapper',
model:{}
});
});
내 예외 :
는Uncaught TypeError: LayoutView is not a constructor