Summary

We've covered a lot of ground in this chapter. You may have not completely understood some of the code in the last section, and this is OK because you will get good at this stuff as we implement our pages for our example application together. Since this chapter was on components, I just wanted to show you the general structure for how to set up parent and child components, and how to pass data from the parent to the child via the child's public interface. However, you should now have a pretty good understanding of how an Angular application is just a tree of components.  What the rule of thumb is for breaking up your components into sub-components and what are annotations and decorators.

We also studied what the @Component annotation/decorator is, what it's properties are, and how to configure them. We then moved on to the @NgModule decorator is, and what some of its properties are, and what purpose they serve. We then studied what content projection is, and how to use it to allow other developers that consume your components to customize of their rendering.

Lastly we studied what life cycle hooks are, how to use them, and reasons why you'd want to use them. We then moved on to component interfaces are and how to create them. Finally, we studies the implementation of the components we need for our three pages (Preview Listing, Photo Listing, and Preview Photo)

In the next chapter, Chapter 7Templates, Directives, and Pipes, we're going to zoom into the template portion of components, since that's where all the data binding and rendering take place—bringing our Angular application from a bunch of 0s and 1s to life on our screens.

Angular provides many tools, in the form of directives and pipes, for us to leverage, so we can tell it how to paint on our canvas. So, turn the page over and let's learn about how we can get Angular to start putting our component paint on our application canvas to bring our application to life—which is where we'll place our components onto our three pages (Preview Listing, Photo Listing, and Preview Photo)

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.228.35