You need to sign in to do that
Don't have an account?
Snl
Lightning: Best practice of using spinner component
Lets say that on a page there are multiple custom components. Some of them bear a parent-child relationship, while some are placed directly on the page. So how should I use the spinner component? Do I need to have the markup of spinner component on every component?
I feel there should be only one spinner component, and that all the components should be able to call it in its controller. Might be inheritance concepts can be used.Please suggest, or provide a link for the sample code.
Also how can I display a spinner component when the page loads for the first time?
As per Lightning developer guide, they recommend using the legacy aura:waiting, aura:doneWaiting, and aura:doneRendering
application events.
I feel there should be only one spinner component, and that all the components should be able to call it in its controller. Might be inheritance concepts can be used.Please suggest, or provide a link for the sample code.
Also how can I display a spinner component when the page loads for the first time?
As per Lightning developer guide, they recommend using the legacy aura:waiting, aura:doneWaiting, and aura:doneRendering
application events.
- May I suggest you to use render event on page load.
- https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_render_handler.htm (http:// https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_render_handler.htm)
- https://developer.salesforce.com/forums/?id=906F0000000g1CHIAY
Hope it will be helpful.Please mark it as best answer if the information is informative.
Thanks
Rahul Kumar
Please find Lightning component best practices below.
http://deepikamatam.blogspot.com/2018/06/salesforce-lightning-component-best.html