From the course: Angular Essential Training

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Angular services and the injectable decorator

Angular services and the injectable decorator - Angular Tutorial

From the course: Angular Essential Training

Angular services and the injectable decorator

- Angular services are a way to separate and reuse code across different parts of your application. You don't need to use services to use Angular but I've seen them in every project I've worked on and all Angular developers should be familiar with how they work. Services work best for things that don't change the UI directly. This might be things like API calls or complex calculations. This keeps your components small and focused only on showing data in the UI. Services are also flexible. You can inject services into other services. You can inject services into components. You can inject services into the entire app or only into one or two specific places. The choice is yours. Services and Angular Dependency Injection are closely linked. You can't use one without the other. In this video, we'll look at a common pattern for building and using services. We'll look at Dependency Injection in detail later in this…

Contents