Sunday, February 5, 2017

What are Nested components and component composition in lightning?

What are Nested components and component composition in lightning?


Component composition is nothing to use to ease the process.  Let’s say if you have 3 to 4 components so instead of calling all those components into your application what we do is create another component which is knows as nested component or wrapper component which calls all these components in itself and then in the application finally we can call that wrapper/Nested component only.

To save our time we are going to use this a lot in lightning applications.  Here is the example

I have 2 components as shown below


Component 1 :  LC.cmp 



Component 2 :  LC2.cmp


Wrapper Component / Nested Component:



Application:  Here I am including/adding that wrappercomponent in my NestedComponent application.

Finally what I am doing here is instead of calling LC,LC2 components, I am calling wrappercomponent that includes booth LC,LC2 components.



Once you click on the preview of your application you can see this output.




4 comments:

  1. I think this article done a great job.What a best way to describe your view. Thanks for sharing with us. Really like your informative article.

    Vex4.org
    Footballgamesunblocked.com

    ReplyDelete
  2. Hi
    I visited your blog you have shared amazing information, i really like the information provided by you, You have done a great work. I hope you will share some more information regarding full movies online. I appreciate your work.
    Thanks
    Top SharePoint Courses Online

    ReplyDelete