backbone.viewevents
v0.3.4
Published
Backbone.View events which bubble
Downloads
3
Readme
Backbone.ViewEvents — an alternative Events implementation for the Backbone.View which provides events which bubble up through a view hierarchy while the latter is inferred from DOM and the views' position in it.
Example:
{View} = require 'backbone.viewevents'
parent = new View().render() child = new View().render()
parent.$el.append(child.$el)
register listener on parent
parent.on 'someevent', (msg) -> console.log('caught!', msg)
trigger event on child
child.trigger('someevent', 'hello')