Passing parameters from Lightning Component to Controller and Controller to Component

In this example to learn about to pass parameters from Lightning component to controller vice versa

By using component.get(v.attributeName) or  component.find(“aura:id”).get(“v.value”) ->pass value from Lightning Component to Controller.
By using component.set(“v.attributeName”,value);  -> pass value from Controller to Lightning Component.


<aura:component >
    <aura:attribute name="employeeName" type="String"/>
    <ui:inputText label="Enter Employee Name"  aura:id="name" />
    <ui:button label="submit" press="{!c.callme}" /> <br />
    Employee Name Entered:  <ui:outputText value="{!v.employeeName}" />

    callme : function(component, event, helper) {
    var EmployeeName = component.find("name").get("v.value");

Written by 

Salesforce MVP | Lightning Champion | 17x Salesforce Certified | Application Architect | 7x Trailhead Ranger | Techforce Services | Australia

Leave a Reply

Your email address will not be published. Required fields are marked *