I have an angularjs app with 2 main folder. Webapp -> admin / user.
Each one contain html and js files in order to display the webapp. All the app. is based on REST principal, so when I get the data from the backend (springMVC/Hibernate/JPA), it's a JSON file.
On the admin side, I have a user.js file with a controller :
Service.userRead($routeParams.id).then(function(data) {
if (data.status == SUCCESS) {
$scope.userIn = data.user;
var color = $scope.userIn.bannerColor;
} else {
logger.warn('userRead: ' + JSON.stringify(data));
$scope.redirectTo('/users');
}
}
On the user side, when the client is on the webapp (not connected to the admin side) I want to obtain the background-color previously stored for a particular user in the database. these hex code is for styling the header.
the question is : how can I retrieve data from the controller user.js and past the variable color to the header controller located in the other folder (HeaderController in user side) ?