Component:
<aura:component >
<aura:attribute name="CustomerName" type="String"/>
<div> Hello...{![Link]} </div>
<ui:button label="Select Harry" press="{![Link]}"/>
<ui:button label="Select Potter" press="{![Link]}"/>
</aura:component>
Client-side Controller:
({
ClickHarry : function(component, event, helper) {
[Link]("[Link]" , "Harry");
},
ClickPotter : function(component, event, helper) {
[Link]("[Link]" , "Potter");
},
})
Lightning App :
<aura:application >
<c:ClickComponent/>
</aura:application>
Explanation :
1.<ui:button> is one of the system�s pre-defined lightning component.
And we can feel free to use them. Once we have created a controller,
we can link the press event by using {!c.[eventName]} in the controller.
2. c. here means controller. And in this instance,
it means the client side controller file. And the eventName is the function name in
your Javascript code.
3. If you are familiar with html and javascript,
you shouldn�t find this piece of code too hard to understand.
And we have used [Link](�[Link]�, [value]); to update the attribute
value.