You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When binding to a can.compute in can.Control with a templated event handler the handler gets the instance of can.Compute not the compute function as it was in 2.1:
test('templated binding a compute',function(){varcomp=can.compute(null);varControl=can.Control.extend({'{mycompute} change': function(value){ok(typeofvalue==='function','Compute change value is a function');}});newControl('#qunit-fixture',{mycompute: comp});comp('test');});
The text was updated successfully, but these errors were encountered:
test('compute change handler context is set to the function not can.Compute',function(){varcomp=can.compute(null);comp.bind('change',function(){equal(typeofthis,'function');});comp('test');});
Basically the change handler context needs to be the can.compute function (which is what it used to be in 2.1) not the new can.Compute object.
daffl
changed the title
Control binding on can.compute change gets can.Compute instance
can.compute change handler context should be the function not the can.Compute object
Jul 8, 2015
When binding to a
can.compute
in can.Control with a templated event handler the handler gets the instance ofcan.Compute
not the compute function as it was in 2.1:The text was updated successfully, but these errors were encountered: