Answer the question
In order to leave comments, you need to log in
Is it possible to store data in an Angular 5 service?
Is it bad manners to store some user data in a separate service? Or is it worth storing everything in the database and making requests to the server to get the data?
Answer the question
In order to leave comments, you need to log in
It can be stored in local storage, but whether it is necessary depends on what the application does and what kind of data it is, usually stored in a remote database, and cached locally. Some less important data is usually stored locally, such as whether to minimize viewed articles or not, but synchronization difficulties arise (we do not take into account browser synchronization).
Where it is possible to use local storage (although it is better to store it on the server):
- save viewed articles
- user settings
Where to use local storage:
- caching
Where it is not possible to use local storage:
- comments, articles, likes / dislikes and all that
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question