In the last blog, I have discussed about the advantages of using Inheritance in lightning component (Link). Probably this topic is a bit small technique to just refresh a component rendering section in a lightning component.
Here I am creating 2 components:
1) ComponentContainer.cmp - which will call the Refresh component.
2) RefreshComponent.cmp - Component gets refreshed every time on click of a button on containing component(component 1).
ComponentContainer.cmp has an attribute refreshFlag, which will be set true/false on Refresh button click based on the existing value. The same variable is used in the aura:if to render either the true/false case. Also passing a attribute RefreshCount to just show the effect of refresh in the RefreshComponent.
Here is the output:
Follow me @ramsujesh
2 comments
Write commentsGreat Info!
ReplyThanks for sharing..
Salesforce Lightning Training
Hello, what is this line component.set("v.refreshComponent", !component.set("v.refreshComponent")) doing?
Reply