function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VIKASH CHAND KUMARVIKASH CHAND KUMAR 

custom setting values in lightning component

Hi, i want to print follwing lines in lightning component.

""please email us on email vikuemail.com or call us on 234 567 890""

1. i want email to show in highlighted in email format, so that when i click on email, it should be direct email. and also phone number highlighted in different color.
2. i want to use this in custom settings, so that based on requirement this statement can be changed.

i wrote a list of String returning both these values in apex, which will be returned to JS and then will be used by component.

but confused, how to implemnt this.
Can anyone please help.
Best Answer chosen by VIKASH CHAND KUMAR
Maharajan CMaharajan C
HI Vikash,

1.   Please create two new attributes  and add the below lines in component

    <aura:attribute name="phone" type="String" />
    <aura:attribute name="email" type="String"/>

        "please email us on email  <ui:outputEmail aura:id="oEmail" value="maharaja0393@gmail.com" />  or call us on <span style="color: orangered">{!v.phone}"</span>

In JS Contoller set the value to above new attributes from apex response in js:
component.set( "v.phone",response.phone);
component.set( "v.email",response.email);



==========================

2.    As alternate i will suggest you to create the two new custom labels for storing the email and phone and you can directly refer the labels in Component as like below without ant controller and server call:

        "please email us on email  <ui:outputEmail aura:id="oEmail" value="{!$Label.c.email}" />  or call us on <span style="color: orangered">{!$Label.c.phone}"</span>  


Thanks,
Maharajan.C




 

All Answers

Maharajan CMaharajan C
HI Vikash,

1.   Please create two new attributes  and add the below lines in component

    <aura:attribute name="phone" type="String" />
    <aura:attribute name="email" type="String"/>

        "please email us on email  <ui:outputEmail aura:id="oEmail" value="maharaja0393@gmail.com" />  or call us on <span style="color: orangered">{!v.phone}"</span>

In JS Contoller set the value to above new attributes from apex response in js:
component.set( "v.phone",response.phone);
component.set( "v.email",response.email);



==========================

2.    As alternate i will suggest you to create the two new custom labels for storing the email and phone and you can directly refer the labels in Component as like below without ant controller and server call:

        "please email us on email  <ui:outputEmail aura:id="oEmail" value="{!$Label.c.email}" />  or call us on <span style="color: orangered">{!$Label.c.phone}"</span>  


Thanks,
Maharajan.C




 
This was selected as the best answer
VIKASH CHAND KUMARVIKASH CHAND KUMAR
thanks a lot Maharaj, i also need to make phone number linkable, can you please help. i have used 2nd option custom label to show the details.