This is a perfect example of when an angular factory could come in handy.
angular.module('yourModuleName')
.factory('yourFactoryName', function() {
var info = "";
return {
getInfo: function() {
return info;
},
setInfo: function(data) {
info = data;
}
}
}
And then in your controllers you would have some code that looked like this:
angular.module('yourModuleName')
.controller('yourControllerName', function($scope, yourFactoryName){
//Makes the factory value available for the controller to use in the view
$scope.holdFactoryValue = yourFacoryName.getInfo();
//In another controller, you could have a function like this declared to change the data
$scope.setFactoryValue = function(data) {
yourFactoryName.setInfo(data);
}
})