creynders/backbone.geppetto — pull request #1 by geekdave (2013-08-30 15:07:59+00:00)
Title: add view injection, and pass-through listen/dispatch methods

View Injection
===========

Dependent classes can add a view injection using:
`injector.mapView(key, clazz);`

Geppetto wraps the original view constructor with a new initialize
method that injects the view's dependencies at the time the view is
constructed. In contrast to the other injections, which Geppetto
delivers as newly-instantiated objects (or singletons), injected views
are returned as a view *constructor*. This is because oftentimes
Backbone Views require initial state to be passed as an options map to
the View's constructor at the time it is instantiated.

Pass-Through listen/dispatch methods
=============================
To avoid exposing the context object to dependent classes, all
dependent classes are now injected with a "listen" and "dispatch"
method that passes through to the original context.

So instead of writing:
`this.context.listen(this, "foo", this.someFunc);`

You can now simply write:
`this.listen(this, "foo", this.someFunc);`

For backwards compatibility, Geppetto.BindContext still assigns the
context to the view as the "context" property. This should be treated
as deprecated in favor of using the pass-through methods directly.