Hello,
I am using the can.Map.delegate plugin:
- var T = can.Map.extend({
- });
- var t = new T();
- t.bind('change', function(ev, attr, how, newVal, oldVal) {
- console.log('Something on t changed', arguments);
- });
- t.delegate('x,y', 'change', function(ev, attr, how, newVal, oldVal) {
- console.debug(attr, 'changed to', newVal);
- });
- t.attr('x', 10); // doesn't display "x changed to"
- t.attr('y', 20); // displays "y changed to 20"
- t.attr('x', 30); // displays "x changed to 30"