title: How to share data between controllers in angularjs
body: <p>I'm currently trying to learn angularJS and am having trouble accessing data between controllers.</p>
  
  <p>My first controller pulls a list of currencies from my api and assigns it to $scope.currencies.  When I click edit, what is supposed to happen is that it switches the view which uses another controller.  now when debugging using batarang, $scope.currencies does show an array of currency objects:</p>
  
  <pre><code>{
      currencies: [{
          CurrencyCode: HKD
          Description: HONG KONG DOLLAR
          ExchangeRateModifier: * ExchangeRate: 1
          DecimalPlace: 2
      }, {
          CurrencyCode: USD
          Description: US DOLLAR
          ExchangeRateModifier: * ExchangeRate: 7.7
          DecimalPlace: 2
      }]
  }
  </code></pre>
  
  <p>But when using <code>angular.copy</code>, the <code>$scope.copiedcurrencies</code> result in null.</p>
  
  <pre><code>function CurrencyEditCtrl($scope, $injector, $routeParams) {
      $injector.invoke(CurrencyCtrl, this, { $scope: $scope });
      $scope.copiedcurrencies = angular.copy($scope.currencies);
      console.log($scope.copiedcurrencies);
  }
  </code></pre>