I have a simple Aura component which is registering a managed package event and then firing it.
I need to call this custom_app:LoadAppEvent
from lwc component instead from an Aura component. is there a way ?
I checked the Migrate Event documentation and you can use dispatchEvent instead of loadAction.fire()
but it doesn't mention anything about how can we work with an managed package event
.
this.dispatchEvent(loadAction);
Aura Code to fire the event:
controller.html
<aura:component implements="forceCommunity:availableForAllPageTypes" access="global">
<aura:registerEvent name="LoadAppEvent" type="custom_app:LoadAppEvent"/>
<aura:handler name="init" value="{! this }" action="{! c.onInit }" />
</aura:component>
controller.js
onInit : function(component, event, helper) {
var loadAction = $A.get('e.custom_app:LoadAppEvent');
loadAction.setParams({
param1: "param1",
param2: "param2"
});
loadAction.fire();
}