I have the following Angular service:
angular.module("app").factory("userService", userService);
userService.$inject = ["$http"];
function userService($http) {
return {
getAuthenticatedUserInfo: function () {
return $http.get("/api/v1/users/me");
}
}
}
I am getting information about the current user such as Id, Name, ...
I want to use this information in my controllers but I do not want to call the API (getAuthenticatedUserInfo) everytime I need that information ... Does it make sense?
What is the best option use this information in other controllers?