Backbone アプリケーション内で CommonJS モジュールを使用して頭を悩ませようとしているので、スケルトンの Backbone View が で定義されてい/views/categories/edit.js
ます。
app.Views.quoteCategoriesEdit = app.Ui.ModalView.extend({
className: '',
template: JST["templates/quotes/categories/quote-categories-edit.html"],
events: {
'click [data-key="save"]': 'save',
'click [data-key="cancel"]': 'cancel'
},
initialize: function (options) {
var that = this;
_.bindAll(this, 'save', 'cancel');
app.Collections.quotesCategories.on('change add', function () {
that.remove();
});
},
render: function () {
var that = this;
// boilerplate render code
return this;
}
});
これを CommonJS モジュールに変換して Browserify で使用する方法を誰かが教えてくれたら、とてもありがたいですし、アプリケーションの残りの部分をモジュール化する方法を理解するのに本当に役立ちます! ありがとう