There ‘CalculateTotal’ component is not bound to the ‘calculate’ controller method

There ‘CalculateTotal’ component is not bound to the ‘calculate’ controller method

Use the below codes

Component Code:

<aura:component >
<ui:inputNumber aura:id=”InputOne”/>
    <ui:inputNumber aura:id=”InputTwo”/>
    <ui:inputNumber aura:id=”InputThree”/>
    <ui:outputNumber aura:id=”totalValue”/>
    <aura:handler name=”init” value=”{!this}” action=”{!c.calculate}”/>
</aura:component>

Controller Code:

({
    calculate : function(cmp) {
Var ip1 = cmp.find(“InputOne”).get(“v.value”);;
Var ip2 = cmp.find(“InputTwo”).get(“v.value”);;
Var ip3 = cmp.find(“InputThree”).get(“v.value”);;
        cmp.find(“totalValue”).set(“v.value”,  parseInt(“ip1”) +  parseInt(“ip2”) +  parseInt(“ip3”));
    }
})

Cheers!!!

Leave a Reply