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
Justin, well, actually I hoped that compute would be be passed as a compute function not as value here is a modified test for this:
test("component does not respect can.compute passed via attributes (#540)",function(){vardata={compute: can.compute(30)}can.Component.extend({tag: "my-component",template: "<span>{{blocks}}</span>",scope: {init: function(){// currently this.blocks is just a value of 30this.blocks(45)}}})vartemplate=can.view.mustache("<my-component blocks='compute'></my-component>");varfrag=template(data)equal(frag.childNodes[0].childNodes[0].innerHTML,"45")});
Don't you think that if component's attr is changed this.attr('blocks', 45 ), then data.compute() value should be updated to? Not it is not, stays the same.
In latest master:
if blocks is can.compute of parent scope it is not passed to component's scope.
It is because of component.js code (line 105)
compute() returns undefined
It worked in previous versions.
The text was updated successfully, but these errors were encountered: