0

I am using 'comment' as a custom label and count as a attribute.

<aura:attribute name="count" type="integer"/>
   <lightning:tab label="{!join($Label.c.comment,v.count)}">

How to display like this: expecting output: comment(10)

0

You can concatenate string as shown below

<lightning:tab label="{!($Label.c.comment + ' (' + v.count + ')' )}">

join(separator, subStr1, subStr2)

  • Joins the substrings adding the separator String (first argument) between each subsequent argument.

    <aura:application extends="force:slds" >
    <!--<c:Parent />-->
    <aura:attribute name="count"  default="10" type="integer"/> 
    
    <lightning:tabset>
        <lightning:tab label="{!(join(' ', $Label.c.comment, join('','(', join('',v.count,')'))))}">
        </lightning:tab>
    </lightning:tabset>
    

  • here v.count is Integer...SO itsnot working..i have make it string but still itsnt working – user52814 Jan 16 '18 at 9:36
  • you are using wrong syntax for join. join first parameter should be separator. I have tested as integer only – Himanshu Jan 16 '18 at 9:39
  • but isnt working lightning:tab have you checked it – user52814 Jan 16 '18 at 9:43
  • can you update your question and put in your attribute code as well. – Mahmood Jan 16 '18 at 9:47
  • set default value for your attribute, like <aura:attribute name="count" type="integer" default=0 />. – Mahmood Jan 16 '18 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy