Пользовательский триггер события магистрали не распознается?

Я изучаю Backbone.js в первый раз, и у меня возникла проблема с попыткой получить пользовательское событие от запуска (или из представления от распознавания, когда оно было запущено )?

Код моей коллекции можно посмотреть здесь:https://github.com/Integralist/Backbone-Playground/blob/master/Assets/Scripts/App/main.js#L72-86который при инициализации запускает пользовательское событие collection:init.

var Contacts = Backbone.Collection.extend({
    model: Contact,

    initialize: function(){
        this.trigger('collection:init');
        this.bind('add', this.model_added, this);
    },

    model_added: function(){
        console.log('A new model has been created so trigger an event for the View to update the  with initial Model data');
    },

    displaySelected: function (event) {
        console.log('get model data and display selected user', event);
    }
});

Любые идеи, что я делаю неправильно?

6
задан nikoshr 28 July 2012 в 15:57
поделиться