Answer the question
In order to leave comments, you need to log in
How can one make an infinite number of dependent views based on one model?
There is a form made on the backbone that works well. Based on the model, a form view is created that tracks changes to the model.
var model = new App.Models.Form();
var form = new App.Views.Form({
model: model
initialize: function () {
this.render();
this.model.on('change', this.setValue, this);
}
});
var config.id = 12345;
$('[data-id=' + config.id + ']').html(form.el);
<div data-id="12345"></div>
<div data-id="12345"></div>
<!--какие-то другие дивы-->
<div data-id="12345"></div>
$('[data-id=' + config.id + ']').each(function(){
$(this).html(form.el);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question