You need to sign in to do that
Don't have an account?
"Using JavaScript Controllers with Components" Lightining Trailhead Challenge - Need Help
Hello , I was trying to complete all challenge about lightining, i was able to pass all of them except "Using Javascript Controller with Components" challenge. I was not able to figure out why trailhead gives the error below :

Here is my component :
and here is my js controler :
Thanks.
Here is my component :
<aura:component > <ui:inputNumber aura:id="inputOne" onError='{!c.handleError}' /> <br /> <ui:inputNumber aura:id="inputTwo" onError='{!c.handleError}' /> <br/> <ui:inputNumber aura:id="inputThree" onError='{!c.handleError}' /> <br/> <ui:outputNumber aura:id="totalValue" value="" /><br/> <ui:button label="Calculate" press="{!c.calculate}"/> </aura:component>
and here is my js controler :
({ calculate : function(component, event, helper) { var inputFirst = component.find("inputOne").get("v.value"); var inputSecond = component.find("inputTwo").get("v.value"); var inputThird = component.find("inputThree").get("v.value"); var total = parseInt(inputFirst) + parseInt(inputSecond) - parseInt(inputThird); component.find("totalValue").set("v.value",total); } })
Thanks.
Strange indeed - looks good.
Please find my code below - I completed this challenge using this:
Component:
Controller:
Hope this helps.
Lukasz
Line 6:
Replace with (It must be sum):
Regards,
Lukasz