8
如何在Angular中使用$ rootScope存储变量?
如何$rootScope在以后要在另一个控制器中访问的控制器中存储变量?例如: angular.module('myApp').controller('myCtrl', function($scope) { var a = //something in the scope //put it in the root scope }); angular.module('myApp').controller('myCtrl2', function($scope) { var b = //get var a from root scope somehow //use var b }); 我该怎么做?