Services & Dependency Injection
In Previous article we have learnt about Angular Forms , In this article we will look into services and dependency Injection in Angular. What is Angular Services? Angular Services are the piece of code or logic that are used to perform some specific task, A code that you can use in many components across application. Also you can say that Angular Services are objects that get instantiated only once during the lifetime of an application. Services contain methods that maintain data throughout the application. The main objective of a service is to organize and share business logic, models or data and functions will multiple component of an application. Services can be implemented though dependency injection. What are Angular Services features? Angular Services are simply typescript classes with the @ Injectable decorator. This decorator tells angular that this class is a service and it will be injected into components that need this service. Service are used to share code across mult...