derickbailey/backbone.modelbinding — Issue #53: Registering of arbitrary output filters
Author: ulmus
Created: 2012-01-04 10:20:53+00:00
State: open

It would be very good to be able to use filters, for date formatting or the like without having to resort to "fake" attributes on the models. I see two ways to do this.

```javascript
Backbone.ModelBinding.registerFilter("dateDisplay", function(attributeName, model){
return model.get("attributeName") // Not a very meaningful filter...
})
```
And in the html

```html
Fubar
```

Another variant could be method lookup on the model, perhaps with a syntax like this:

```html
Fubar
```

In this case, the binding would listen to change-events on attributeName, but would display the result of model.alternateDisplay()

Together with some kind of registerParser function for the inverse binding (as in #45) this would make for a still very lightweight, but more flexible framework!

Comments? I haven't looked at the code yet, but if there is enough interest, I could look into the implementation.