2 respostas
Hi Anji,
Please find the solution.
test: function(c,e,h){
var a=c.get("v.aval");
var b=c.get("v.bval");
var cval=a+b;
console.log("outside if:::"+cval);
if(cval){
console.log("Inside if:::"+cval);
c.set("v.cval",cval);
}
}
Actually, In your code, there is no data inside this variable "cval" so how you can set if there is no data.
I have correct your code if there is no data then it will not enter inside the if statement.Please let me know it is working or not.Please mark it as the Best Answer if it helps you.Thank Youc.set("v.cval",cval);