Answer the question
In order to leave comments, you need to log in
What is the best way to load data that is used on different pages?
Good afternoon!
There is the same data which is used on several pages /users and /clients.
There are two services userService.js and clientsService.js that can load this data.
The server, on the /users and /clients pages, always returns this data.
For example, on the /users page, in the code it turns out like this:
userService.load().then(data => clientsService.setClients(data.clients));
$q.all([
usersSerivce.load(),
clientsService.load()
]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question