Answer the question
In order to leave comments, you need to log in
How to get and store data on page state change in Angular 1.5?
Hello!
There are a few questions that I can't find the answer to myself.
1 - What is the best way to get data for a page if it requires several types of data?
Send one request that will return all the data and scatter them over the necessary services manually or send your own request for each type of data?
For example, for a task page, you need to get: a list of tasks, a list of users, a current user.
2 - Is it worth it to constantly request data when navigating through pages?
For example:
We got to the task page - we made a request to get data.
We went to the users page - we made a request to receive data.
Did you return to the tasks page, get the data from the cache or make a request again?
Answer the question
In order to leave comments, you need to log in
Your questions are from the category of building an application architecture - there are no recipes here.
Most likely in case 1 it is wrong to put everything in 1 request, but there are situations when this is acceptable and beneficial.
In case 2 - absolutely no recipes, but there is a famous phrase (not verbatim) "There are two really difficult problems in programming - variable naming and cache invalidation"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question