How can we call child component controller method from the parent component controller method? : salesforce lightning component
Answer / Sarvesh Siddharth
To call a child component's controller method within the parent component's controller, you can use the `$A` utility to find and invoke the desired method. Here's an example:
```javascript
// In Parent Component Controller
{!c.init}
function init() {
var childComponent = this.find('childComp'); // Assuming the child component's aura:id is 'childComp'
$A.enqueueAction(actionFunction);
function actionFunction() {
childComponent.callChildMethod(); // Calling child component's method
}
}
```
| Is This Answer Correct ? | 0 Yes | 0 No |
Mention how many relationship is included in sfdc and what are they?
How to update the record using after trigger context?
Define sosl ?
What is javascript remoting for apex controllers?
If the workflow field update & trigger on the same set of attribute and action, will it fall under infinite loop?
Is it possible to fire validation only for records which is being getting updated not to newly inserted records? : salesforce validation rules
What is a static resource in salesforce?
What may be reason truncate button is not visible on custom object?
What are different types of reports? : salesforce reports and dashboards
What is field dependency and how many can be used in a visualforce page?
Explain Assignment process & validations.
What is aura? Why do we use the aura: namespace in the code ? : salesforce lightning component