こんにちは、次のことをどのように行うかを理解するのに苦労しています。
レンダリングするバックボーン ビューがあり、そのビュー内の dom 要素に別のビューを追加したいと考えています。
これが私のコードです。
define([
'jquery',
'underscore',
'backbone',
'views/common/parent',
'text!templates/currentAccounts.html',
'text!templates/guidesTools.html'
], function($, _, Backbone, ParentView, mainTemplate, subTemplate){
var accountsView = ParentView.extend({
render : function() {
this.$el.html(mainTemplate);
}
});
return new accountsView;
});
サブテンプレート (guidesTolls.html) をメイン テンプレート内の dom 要素にアタッチする必要があります。これを行う最良の方法は何ですか?