AuraConditionalRendering
When Checkbox is true Education is displayed
<aura:application extends="force:slds">
<aura:attribute name="variable" type="Boolean" />
<lightning:input aura:id="Education" type="checkbox"
label="Education"
name="Education" value="Education"
onchange="{!c.handleCheck}" />
<aura:if isTrue="{!v.variable}">
<div>Secondary</div>
<div>Intermediate</div>
<div>Degree</div>
<aura:set attribute="else">
No Education
</aura:set>
</aura:if>
</aura:application>
({
handleCheck : function(component, event, helper) {
var isChecked = component.find("Education").get("v.checked");
console.log('isChecked'+isChecked);
component.set("v.variable", isChecked);
}
})
Comments
Post a Comment