에 전달하면 뷰 변수에 questions 변수를 전달할 수 있습니까?데이터를 렌더링 Backbone.js
Ive는 가져 오기에서 this.render를 호출하려고 시도했으나 오류가 발생했습니다. 아마도이 때문일 수 있습니다. 올바른 범위에 있지 않습니다.
app.AppView = Backbone.View.extend({
initialize: function(){
var inputs = new app.Form();
inputs.fetch({
success: function() {
var questions = inputs.get(0).toJSON().Questions;
app.validate = new Validate(questions);
app.validate.questions();
}, // End Success()
error: function(err){
console.log("Couldn't GET the service " + err);
}
}); // End Input.fetch()
this.render();
}, // End Initialize
render: function(){
el: $('#finder')
var template = _.template($("#form_template").html(), {});
this.$el.html(template);
}