I am trying to display some text on Page by using Lighting componets.i am not getting that text on click on check box Below is my code .Let mek nwo where is my code wrong.
A>Component attribute define
<aura:attribute name="CheckBoxValue" type="Boolean" default="false"/>
Lightning tag with aura id defined in it
<lightning:input aura:id="checkBoxAM" label="Are you new to this course" name="HaveYouTakenCourseBefore" type="checkbox" onchange="{!c.onClickCheckBox}"/>
B>This is my Aura if conditiontag along with text to be displayed
<aura:if isTrue="{!v.CheckBoxValue}">
<br/>
Hello You have checked this box
</aura:if>
C>THis is my JS function in Controller
onClickCheckBox: function(component,event,helper) {
// accesing the value of attribute HaveYouTakenCourseBefore;
// Call function defined in helper;
// hlpr.<Function Name in helper>
console.log("This text is from helper function");
helper.onClickCheckBoxhelper(component);
}
D>This is my FUnction defined in helper
onClickCheckBoxhelper : function(component) {
//body of helper resourse
// define logic of your function
console.log("This text is from helper function");
var checkBoxValue = component.find("checkBoxAM").get("v.checked");
component.set("v.checkBoxAM",checkBoxValue);
E> Calling this Component in my Lightning App