This question has been asked before but this is more of what style to use. Currently we have several different controllers, and we keep making a REST call to get information. For example, $http.get('/allusers')
. After we make this call, we create a user map to access each of these users. It works great but I don't like how we have to manually do this every time we need user information from the different controllers.
What I'd like is a shared object that has all the user information as a map and a shared function that will make the call and create/update the map.
This is where I start to get confused. What is the best and efficient way to approach this?