Services are not only great for sharing data, they can also provide notifications. we can use the service to broadcast a notification to components/services about state changes without the need to wait for the component to ask for the new state.Continue reading “Angular Service: Notification”
communication is all about sharing and we can use services to share entity data across components. entity data can be for example posts, products, songs, movies and so on. this kind of service is a data access service.
We use the service as a data access service to encapsulate the common operations with data like get, add, update and delete data items. in the service we create methods that usually will make HTTP requests to get, add, update and delete data. each component that needs the data will use the service to get the data and will make an action on the data through the use of the service.Continue reading “Angular Service: State Management”
There are several ways to manage state with services and the simplest one is named “property bag”. it means that the service is like a bag of properties with no real logic or state management. this type of service exposes simple properties that the components use to communicate state among themselves.Continue reading “Angular Service: Property Bag”
Angular services are a very important building block in angular, they can help us to centralize general tasks, share data, prevent code duplication and to communicate between components.Continue reading “Angular Services”