You need to sign in to do that
Don't have an account?
srikanth k 169
property 'config' of undefined
Hellow,
i am facing an error with a lightning component since this weekend. I can't figure out why this message occures.
Appilcation:
<aura:application extends="force:slds" >
<c:additioncomponent/>
</aura:application>
component:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<lightning:input label="enter val1" aura:id="value1" type="number"/>
<lightning:input label="enter val2" aura:id="value2" type="number"/>
<lightning:input label="result" aura:id="res" type="number"/>
<lightning:button label="add" onclick="{!c.show}"/>
</aura:component>
Controller:
({
show :function(component, event, helper) {
var val1=component.find("value1").get("v.value");
alert("val1::"+val1);
var val2=component.find("value2").get("v.value");
alert("val1::"+val1);
var result=parseInt(val1)+parseInt(val2);
alert("result::"+result);
var val1=component.find("res").set("v.res",result);
}
})
I am able to pring the result value. not sure what is the issue with below the line.
var val1=component.find("res").set("v.res",result);
Could some one please help me on this isuse.
i am facing an error with a lightning component since this weekend. I can't figure out why this message occures.
Appilcation:
<aura:application extends="force:slds" >
<c:additioncomponent/>
</aura:application>
component:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<lightning:input label="enter val1" aura:id="value1" type="number"/>
<lightning:input label="enter val2" aura:id="value2" type="number"/>
<lightning:input label="result" aura:id="res" type="number"/>
<lightning:button label="add" onclick="{!c.show}"/>
</aura:component>
Controller:
({
show :function(component, event, helper) {
var val1=component.find("value1").get("v.value");
alert("val1::"+val1);
var val2=component.find("value2").get("v.value");
alert("val1::"+val1);
var result=parseInt(val1)+parseInt(val2);
alert("result::"+result);
var val1=component.find("res").set("v.res",result);
}
})
I am able to pring the result value. not sure what is the issue with below the line.
var val1=component.find("res").set("v.res",result);
Could some one please help me on this isuse.
The issue is the below line (Line No: 9):
var val1=component.find("res").set("v.res",result); ---> var val1=component.find("res").set("v.value",result);
set("v.value") not set("v.res")
Thanks,
Maharajan.C
I've Made Some Changes just Copy Paste
Try The Below Code.
Please Mark It As Best Answer If It Helps.
Thank You!
No need of assign the result in val1.
Thanks,
Maharajan.C