marionettejs/backbone.marionette — pull request #665 by paultyng (2013-06-30 18:34:50+00:00)
Title: Change renderer context to invoking template

In some cases I have written custom template selection based on model/view state. The method that invokes the template (`View.template`) isn't run in context of the template, but the window, so I needed to manually bind it to the views, which isn't desirable for things like mixins.

This would correct that.

An example is:

```CoffeeScript
class UserDefinedFieldView extends Marionette.ItemView
template: (data) ->
fieldType = @model.get("fieldType")
JST["templates/#{fieldType}"].call(@, data)
```

Where the template chosen varies based on a field type (for example a date template vs a text template).