Skip to content

Commit

Permalink
Update marionette.view.md
Browse files Browse the repository at this point in the history
Backbone.Events.listenTo no longer accepts a 4th 'context' parameter. Updated documentation to reflect this, including an example of the workaround for those cases where it is desired.
  • Loading branch information
recurse committed Jun 5, 2013
1 parent c20d384 commit 5aa737e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/marionette.view.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ MyView = Backbone.Marionette.ItemView.extend({
```

The context (`this`) will automatically be set to the view. You can
optionally set the context by passing in the context object as the
4th parameter of `listenTo`.
optionally set the context by using `_.bind`.

```js
// While the view is active, inject a reconciliation callback into the collection.
this.listenTo(this.collection, "add", _.bind(this.reconcileCollection, this.collection));
```

## View close

Expand Down

0 comments on commit 5aa737e

Please sign in to comment.