mikeric/rivets — pull request #179 by bbarr (2013-06-19 16:38:22+00:00)
Title: Store models reference on view

This PR introduces a reference on every view that points to the original models object that it is scoped to.

Currently, in the 'each-*' binding routine, the models object gets rebuilt for independence among the sub-views. This means that when you are inside of an event callback, you cannot alter properties on the original object.

Adding a reference to the original model, allows an event binding handler like this:
```javascript
rivets.configure({
handler: function(context, ev, binding) {
this.call(binding.view.modelsRef, ev, binding.view.models);
}
});
```
And this terribly contrived, but hopefully demonstrative, view:
```javascript
function View() {
this.data = 'foo';
this.count = 0;
}

// function bound within an iteration block
View.prototyp.myClickEvent = function(e, ctx) {
this.data = ctx.someIteratedModel;
this.count++;
}

rivets.bind(div, new View)