我想将一些数据分配给在页面加载时初始化的全局变量(可能是 $rootscope)。然后我想从所有控制器访问这些数据。我该怎么做?
// Edit : I tried following and it works as expected....
function Ctrl1($rootScope) {
$rootScope.value = "asdf";
}
function Ctrl2($rootScope, $scope) {
$scope.value = $rootScope.value;
}