backbone.viewevents

Backbone.View events which bubble

npm install backbone.viewevents
10 downloads in the last week
20 downloads in the last month

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')

npm loves you