+ Start a Discussion
JasonGJasonG 

How do I get the value of my aura:attribute in my JavaScript Controller?

I am trying to get the value of the aura:attribute in the js controller.
<aura:component>
  
  <aura:attribute name="falseValue" type="boolean" default="false" />
  
  <ui:button label="Log Value"  press="{!c.logValue}"/>

<aura:component>
js function
({    
  logValue : function(component, event, helper) {
        console.log(v.falseValue);
    }
})
What would I do to get the value false returned from the aura attribute.

 
Best Answer chosen by JasonG
Raj VRaj V
You can get as shown below 

component.get("v.falseValue")


Complete code is here 


<aura:component>
  
  <aura:attribute name="falseValue" type="boolean" default="false" />
  
  <ui:button label="Log Value"  press="{!c.logValue}"/>

<aura:component>




({    
  logValue : function(component, event, helper) {
        console.log(component.get("v.falseValue"));
    }
})