-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
component does not respect can.compute passed via attributes #540
Comments
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(){
var data = {
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 30
this.blocks(45)
}
}
})
var template = can.view.mustache("<my-component blocks='compute'></my-component>");
var frag = template(data)
equal(frag.childNodes[0].childNodes[0].innerHTML, "45")
}); |
Yes, but you should still be able to do |
Ok, that makes sense. |
Don't you think that if component's attr is changed |
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: