Book Image

Learning Angular - Second Edition

By : Christoffer Noring, Pablo Deeleman
Book Image

Learning Angular - Second Edition

By: Christoffer Noring, Pablo Deeleman

Overview of this book

<p>The latest version of Angular comes with a lot of new features that help you to make your applications smaller and faster. This book will show you how to set up an Angular project, and you’ll build Angular components right from the beginning.</p> <p>Moving on, you’ll explore and work with the components to build your app. Next, you’ll find out more about TypeScript and see how to use it to build apps in the best way possible. You’ll then be introduced to the building blocks - Properties, Events, Directives, and Pipes - and how it can be used to implement and enhance the components.</p> <p>Additionally, you’ll be using Angular components to organize your components in a scalable way. Then you’ll understand how to get data in your app and add navigation to it. Furthermore, you’ll deep dive and work with Forms, Authentication, and see how Material design will help you make your app beautiful in just a few short lines of code. Lastly, you’ll see how to use animating components with Angular, and test and debug the app.</p> <p>All in all, the overall mission is to give you a great start when developing apps using Angular and TypeScript.</p>
Table of Contents (21 chapters)
Title Page
Credits
About the Authors
www.PacktPub.com
Customer Feedback
Preface
2
IDEs and Plugins

How dependency injection works in Angular


As our applications grow and evolves, each one of our code entities will internally require instances of other objects, which are better known as dependencies in the world of software engineering. The action of passing such dependencies to the dependent client is known as injection, and it also entails the participation of another code entity, named the injector. The injector will take responsibility for instantiating and bootstrapping the required dependencies so they are ready for use from the very moment they are successfully injected in the client. This is very important since the client knows nothing about how to instantiate its own dependencies and is only aware of the interface they implement in order to use them.

Angular features a top-notch dependency injection mechanism to ease the task of exposing required dependencies to any entity that might exist in an Angular application, regardless of whether it is a component, a directive, a pipe...