Created
November 28, 2017 09:11
-
-
Save bolaurent/9b5b35bd0d2dab46cd138037ee1add7d to your computer and use it in GitHub Desktop.
auraIfAdvanced (salesforce lightning component)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:documentation> | |
<aura:description>Documentation</aura:description> | |
<aura:example name="ExampleName" ref="exampleComponentName" label="Label"> | |
<!-- | |
<c:auraIfAdvanced list="["a","b","c"]" element="b"> | |
WhateverU_NeedHere | |
</c:auraIfAdvanced> | |
--> | |
</aura:example> | |
</aura:documentation> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component> | |
<aura:handler name="init" value="{!this}" access="global" action="{!c.doInit}" /> | |
<aura:attribute name="list" type="Object[]" /> | |
<aura:attribute name="element" type="String" /> | |
<aura:attribute name="condition" type="Boolean" default="false" /> | |
<aura:if isTrue="{!v.condition}"> | |
{!v.body} | |
</aura:if> | |
</aura:component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
doInit: function(component, event, helper) { | |
if (component.get('v.list').indexOf(component.get('v.element')) > -0 ) | |
component.set('v.condition',true); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment