Hello.
I have a can.Observe and want to listen to it's changes in a can.Control using the "property-event-binding".
According to this thread it should be possible:
But in my case it does not fire the event. I think that it is defined in the wrong scope, so the Control does not know what "cat" is. This is my code:
- can.Observe "Cat",
- init: (name) ->
- @_super
- name: name
- toString: ->
- @attr "name"
- can.Control "Testapp.Controller.Global",
- init: (el, options) ->
- @cat = new Cat "mittens"
- @cat.attr "name", "nelly"
- "{cat} name": (args...) ->
- console.log args
The name change works on live binding to an EJS template but the event is not fired.
Does anyone know what has to be changed?
Thanks in advance,
Gammanator