Sample Code:
Lightning Component:
<ui:inputText label=”First Name” value=”{!v.firstname}”/>
<ui:button label=”Register” press=”{!c.registerUser}”/>
</aura:component>
Lightning Component:
<aura:component implements=”forceCommunity:availableForAllPageTypes”>
<aura:attribute name=”firstname”/>
<ui:inputText label=”First Name” value=”{!v.firstname}”/>
<ui:button label=”Register” press=”{!c.registerUser}”/>
</aura:component>
Lightning Component Controller:
({
registerUser : function(component, event, helper) {
alert(component.get(“v.firstname”));
}
})