I have an endless scroller that adds new elements to the page as the user scrolls. I would like several subscribers to be able to bind to the event that I fire each time new elements are added.
Is it possible that I can create a custom event as I can in Backbone?
For example, in the basic structure, I can create such a model:
this.vent = _.extend({}, Backbone.Events);
Then I can bind the events as follows:
this.vent.bind('my:custom:event', this.handler);
And I can run them as follows:
this.trigger('my:custom:event', args);
Is it possible to use Ember.evented like this, or is there a better way?
source
share