derickbailey/backbone.modelbinding — Issue #76: Alter html attributes, and use of functions in data-bind?
Author: meskyanichi
Created: 2012-03-01 19:18:07+00:00
State: open

Wasn't sure whether these are supported, but it doesn't look like it.

I have a model in which I have a `path()` method that generates a URL which I would like to pass in to a `href` in an `a` tag.

**My Model**

```coffee
class MyModel extends Backbone.Model
path: ->
# string generation logic returns a string
```

**My Template**

```html
Click the link:
```

I'm not sure whether this is, or would be possible since path() is a method and I'm not sure whether you can listen for function invocation events. Although in this example it wouldn't be something that'd ever change.

In any case, it seems to me that I'm doing 3 thing's that aren't possible:

* Setting a `href` attribute on the `a` element
* Calling a models `path()` function to populate the `href` attribute
* Calling two `data-bind` in the same html element

I played with batman.js the other day and they seem to handle data-binding like so:

```html

```

Is there any way to accomplish the 3 points mentioned above with the current version of Backbone.ModelBinding, or are they planned for future releases?

Cheers