Passing variables from one controller to another with $rootscope
问题 I'm trying to pass the id from one controller onto the next using $rootscope. I thought it was as simple as setting the variable to $rootscope, but for some reason when i check in console it comes up as undefined. This variable will not change and i'd like to have it be "global" for all following controllers. Any reason why this isn't getting set? .controller('CubeHeadCtrl', ['$scope', '$rootScope', '$stateParams', 'cubeHeadFactory', 'localUserFactory', '$q', function($scope, $rootScope,