function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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 VakatiRaj Vakati
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"));
    }
})