Answer the question
In order to leave comments, you need to log in
How to create an API adapter in Angular?
There is a service which is used by several components.
How to write an adapter - API layer for this service?
Or is this not necessary, while the service itself is already a kind of API?
Answer the question
In order to leave comments, you need to log in
Or is this not necessary, while the service itself is already a kind of API?
Yes.
Sometimes combined with a storage/caching service, sometimes not.
Good practice is one api family - one service. Type usersService, it has GET, POST, etc. users.
Additional manipulations with requests, insert the header there, redirect - in interceptors.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question