politician/outback — Issue #7: Create an "on" event binding
Author: politician
Created: 2012-02-14 17:07:47+00:00
State: open

The "on" binding should function as a setter of model attributes. The set behavior may be extensible. This is not a free-form "eval" binding, and it does not call arbitrary functions on views or models.

```CoffeeScript

modelBindings:
'button': on: { eventName: 'click', toggle: modelref 'foo' }

```

The purpose of the "on" handle is to facilitate setting model attributes without the ceremony of:

```CoffeeScript

events:
'click button': 'toggleFoo'

toggleFoo =>
current = @model.get 'foo'
@model.set foo: !current

```