テンプレートをビューに渡そうとしています。使用したいテンプレートがいくつかあり、ルーターでそれらを切り替えられるようにしたいと考えています。エラーは発生しませんが、結果は得られません。initialize2番目のビューではメソッドが呼び出されていないようです。これが私のコードです:
   (function() {
        window.App = {
            Models: {},
            Collections: {},
            Views: {},
            Router: {}
        };
        window.template = function(id) {
            return _.template( $('#' + id).html() );
        };
        var vent = _.extend({}, Backbone.Events);
        _.templateSettings.interpolate = /\[\[(.+?)\]\]/g;
        App.Router = Backbone.Router.extend({
            routes: {
                '' : 'index',
                'send-message' : 'sendMessage',
                '*other' : 'other'
            },
            index: function() {
                t = new (App.Collections.Tables.extend({ url: 'main-contact'}))();
                tables = new (App.Views.Tables.extend({
     collection: t, template: template('mainContactTemplate')}))();
                $('#web-leads').html(tables.el);
            },
            sendMessage: function() {
                t = new (App.Collections.Tables.extend({ url: 'send-message'}))();
                tables = new App.Views.Tables.extend({
     collection: t, template: template('sendMessageTemplate')});
                $('#web-leads').html(tables.el);
            },
            other: function() {
            }
        });
        // Main Contact
        App.Models.Table = Backbone.Model.extend({});
        App.Collections.Tables = Backbone.Collection.extend({
            model: App.Models.Table,
            initialize: function(models, options) {
                this.fetch({
                    success: function(data) {
                        //console.log(data.models);
                    }
                });
                if (options) {
                    this.url = this.url || options.url;
                }
            }
        });
        App.Views.Tables = Backbone.View.extend({
            tagName: 'ul',
            initialize: function() {
                this.collection.on('reset', this.render, this);
            },
            render: function() {
                return this.collection.each(this.addOne, this);
            },
            addOne: function(model) {
                var t = new App.Views.Table({ model: model, template: template});
                this.$el.append(t.render().el);
                return this;
            }
        });
        App.Views.Table = Backbone.View.extend({
            tagName: 'li',
            template: this.template,
            initialize: function (attrs) {
                this.options = attrs;
                console.log(this.options);
            },
            render: function() {
                this.$el.html(this.template(this.model.toJSON()));
                return this;
            }
        });
        new App.Router();
        Backbone.history.start();
    })();
編集:私はいくつかの括弧が欠けていました。しかし今、私は認識されない表現のエラーを受け取ります。Initializeが呼び出されています。