Thanks for the reply Maxisme. I know about compute.bind however and that's not what I'm looking for. When you set a function as the value on Map with attr it automatically turns it into a compute.
As I understand it, essentially this...
- state.attr('baz', function () {
- return this.attr('foo') + ", " + this.attr('bar');
- });
...is the same as this...
- state.attr('baz', can.compute(function () {
- return this.attr('foo') + ", " + this.attr('bar');
- }));
So, my question is, on these computed values, how can I listen for when they change? I've tried the code I posted above and I've also tried doing something along these lines...
- state.attr('baz').bind('change', handler);
...but neither of these approaches seem to work... also, even if the latter approach did work, I don't want to do that ... I want to use can.Map's templated event binding as in my first example.
Any other thoughts on this?
Thanks again for the help.
-Mac