I want to be able to reference an element in a Lightning component that's nested in a parent component.
Child component (named "MyChildComponent")
<aura:component>
<lightning:input aura:id="childComponentElement"
type="text"
label="My Child Component Input" />
</aura:component>
Parent component
<aura:component>
<c:MyChildComponent aura:id="childComponent" />
</aura:component>
I'm trying to reference the child from the parent controller.js so I can hide the input at certain times:
Parent Controller.js
var myChildComponentElement = component.find("childComponentElement ");
$A.util.addClass(myChildComponentElement , "slds-hide");
But that doesn't seem to work. Any thoughts?