Comment utiliser $rootScopepour stocker des variables dans un contrôleur auquel je souhaite accéder ultérieurement dans un autre contrôleur? Par exemple:
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
});
Comment pourrais-je faire ça?