Posts

Showing posts with the label Wire

Parent-Child Child-Parent Event Communication Refresh LWC Component on Wire

Apex     @AuraEnabled (cacheable= true )      public   static   List < Account > getAccounts(){          return  [ Select   Id , Name , Industry ,phone  from   Account   where   Industry != Null   and   Phone != null   limit   10 ];     } Parent  < template >      < lightning-card   title = "Decorate a Function with @wire"   icon-name = "custom:custom63" >          < div   class = "slds-m-around_medium" >              < template   if : true = { accounts } >                         <!-- Passing accountList to child -->       ...

Using Wire Apex

Using Wire Apex Scenario 1: Using Wire Apex: AccountCountroller.html <template>      <lightning-card title= 'Account' >          <ul>          <lightning-card title= "Account List" >              <div class= "slds-m-around_medium" >                  <template if:true= {accounts.data} >                      <template for:each= {accounts.data}  for:item= "acc" >                          <p key= {acc.Id} > {acc.Name} ...