Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Greetings to you!
You can use aura:method or events. Please refer to the below links which might help you further with the above requirement.
https://sfdcpanther.wordpress.com/2018/01/05/call-child-component-controller-from-parent-component-aura-method/
https://sfdcpanther.wordpress.com/2017/12/03/play-with-events-in-lightning-component-part-1/
https://sfdcpanther.wordpress.com/2017/12/07/play-with-events-in-lightning-component-part-2/
https://sfdcpanther.wordpress.com/2017/12/25/play-with-events-in-lightning-component-part-3/
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
ITs not regarging communicating with components. more over how to get the list of components inside a component in js.
If you are using Iteration in creating child component you can make use of Events and List attribute to store the created compoonents.
Example:
Parent Component:
<aura:attribute name="childcomponents" type="List"/>
<aura:handler name="cmpevent" event="c:cmpEvnt" action="{!c.addCmpToList}"
<aura:iteration>
<c:childComponent />
</aura:iteration>
child Component :
<aura:registerEvent name="cmpEvent" type="c:cmpEvent"/>
<aura:handler name="init" value="{!this}" action="{!doinit}"/>
//Markup...
JS
doInit: function(cmp,event,helper){
//Get the Custome Event
//Assign the cmp to the event as parameter
//fire the Event
}
Catch the fired event in parent controller addCmpToList Method and retrive the created component from event and push into the List.
Kindly Let me know if it helps you to solve your query...
Thanks And Regards,
Kranthi