eShopSync

How to implement loading sign in lightning component salesforce

In this blog we will learn how to implement loading sign in lightning component. You can refer to the code below:

 

Loading sign in lightning component

Here is the code :

Component –

<aura:component access="global">
        <ui:spinner aura:id="spinner"/>
        <ui:button press="{!c.toggleSpinner}" label="Toggle Spinner" />
</aura:component>

Controller –

({
    toggleSpinner: function(cmp) {
        var spinner = cmp.find('spinner');
        var evt = spinner.get("e.toggle");
        
	if(!$A.util.hasClass(spinner, 'hideEl')){
	    evt.setParams({ isVisible : false });
	}else {
	    evt.setParams({ isVisible : true });
	}
        evt.fire();
    }
})

Output

Here is the output –

Support

That’s all for how to implement load sign in lightning component, still have any issue feel free to add a ticket and let us know your views to make the code better https://webkul.uvdesk.com/en/customer/create-ticket/

 

Exit mobile version