The spinner i used is loading around 6 times, How to make it to load only once after all the methods are called and data is loaded on the Fields.
Component:
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="Provider" type="SysConct_Provider_detail__c" default="{
<aura:handler event="aura:waiting" action="{!c.showSpinner}"/>
<aura:handler event="aura:doneWaiting" action="{!c.hideSpinner}"/>
<aura:attribute name="Spinner" type="boolean" default="false"/>
<aura:attribute name="isOpen" type="boolean" default="false"/>
<aura:if isTrue="{!v.Spinner}">
<div aura:id="spinnerId" class="slds-spinner_container">
<div class="slds-spinner--brand slds-spinner slds-spinner--large slds-is-relative" role="alert">
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
</div>
</div>
</aura:if>
Controller.js :
doInit : function(component, event, helper) {
helper.doProvider(component); //call provider details
},
showSpinner: function(component, event, helper)
{
component.set("v.Spinner", true);
},
hideSpinner : function(component,event,helper)
{
component.set("v.Spinner", false);
},
v.spinner
to false in controller when all service calls are made or inafterRender
file.