You need to sign in to do that
Don't have an account?
Mohau Twala
Failed to save AccountSearch.cmp: No EVENT named markup://c:AccountsLoaded found : [markup://c:AccountSearch]: Source
HI I an getting this error : Failed to save AccountSearch.cmp: No EVENT named markup://c:AccountsLoaded found : [markup://c:AccountSearch]: Source when trying to save this code below:
<aura:component controller="AccountSearchController">
<aura:registerEvent name="accountsLoaded" type="c:AccountsLoaded"/>
<aura:handler name="init" value="{!this}" action="{!c.onInit}"/>
<aura:attribute name="searchTerm" type="String" default="San Francisco"/>
<lightning:card title="Account Search" iconName="standard:search">
<div class="slds-form slds-p-around_x-small">
<lightning:input
label="Search"
variant="label-hidden"
value="{!v.searchTerm}"
placeholder="Search by name, phone, website, or address"
onchange="{!c.onSearchTermChange}"/>
</div>
</lightning:card>
</aura:component>
<aura:component controller="AccountSearchController">
<aura:registerEvent name="accountsLoaded" type="c:AccountsLoaded"/>
<aura:handler name="init" value="{!this}" action="{!c.onInit}"/>
<aura:attribute name="searchTerm" type="String" default="San Francisco"/>
<lightning:card title="Account Search" iconName="standard:search">
<div class="slds-form slds-p-around_x-small">
<lightning:input
label="Search"
variant="label-hidden"
value="{!v.searchTerm}"
placeholder="Search by name, phone, website, or address"
onchange="{!c.onSearchTermChange}"/>
</div>
</lightning:card>
</aura:component>
Please make sure that you created a component or application event called "AccountsLoaded.evt" in your sandbox before saving the lightning component.
<aura:event TYPE='.....'>
.....
</aura:event>
Kindly Mark this as a Best Answer if you Find this Useful!
Thanks,
DineshKumar Gopalakrishnan
For creating an Event please refer this (https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_component_example.htm)
Hope this resolves the issue