Shopify/batman — Issue #264: Bindings broken in default app
Author: jlong64
Created: 2011-12-01 21:06:11+00:00
State: open

Hey friends,

It seems that bindings are somewhat broken. When creating a new app and running it without any modifications, the little example "mission" binding doesn't work -- the string shows up on the page as "Test is ready to !". Changing the text field doesn't modify the value of the mission property either.

I brought up the example apps to see if they worked. The hello app works fine, and the alfred app works with some issues (the string at the bottom shows the todo count twice).

I toyed with the default app to get it to work more like the example apps to figure out what needed to be changed to get it to work. Here's what I changed to get it working:

I moved the bound property from the Batman.App subclass to the AppController. Then instead of binding to "Test.mission" I bound to "controllers.app.mission". The HTML won't be set with the property's initial value, however -- you need to set the property manually to get it to display. For example:

```coffeescript
class Test.AppController extends Batman.Controller
@set "mission", "fight crime" # Won't show up.

index: ->
@set "mission", "something else" # Shows up.
```

I tested this on the latest version of Safari, Chrome and Firefox on OS X, both on 0.8.0 and latest.

Thanks!