Building an Application with Angular Components

We have reached a point in our journey where we can successfully develop more complex applications by nesting components within other components, in a sort of component tree. However, bundling all our component logic in a unique file is definitely not the way to go. Our application might become unmaintainable very soon and, as we will see later in the chapter, we would be missing the advantages that Angular's dependency management mechanism can bring to the game.

In this chapter, we will see how to build application architectures based on trees of components, and how the new Angular dependency injection mechanism will help us to declare and consume our dependencies across the application with minimum effort and optimal results.

In this chapter, we will cover these topics:

  • Best practices for directory structures and naming conventions
  • Different approaches to dependency injection
  • Injecting dependencies into our custom types
  • Overriding global dependencies throughout the component tree
  • Interacting with the host component
  • Overviewing the directive lifecycle
  • Overviewing the component lifecycle
..................Content has been hidden....................

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