title: Why my service does not share data between controllers?
body: <p>I built a factory to get Data from the Database and pass to all controllers in my application like this:</p>
  
  <pre><code>(function () {
      angular.module('appContacts')
          .factory('dataService', ['$http', dataService]);
  
      function dataService($http) {
  
          return {
              getCurrentOrganization: getCurrentOrganization,
          };
  
          function getCurrentOrganization(id) {
  
              return $http({
                  method: 'GET',
                  url: '/api/organization/' + id + '/contacts'
              })
          }
      }
  
  })();
  </code></pre>
  
  <p>And I have a view like this:</p>
  
  <pre><code>&lt;div ng-app="myapp"&gt;
    &lt;div ng-controller="contactController"&gt;
       &lt;a ui-sref="organization({Id: organization.id})" ng-click="vm.setCurrentOrganization(organization)"&gt; {{organization.organizationName }}&lt;/a&gt;
   &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>That link redirect from a view the view contactsView.html to a detail view organizationDetail.html managed by a second controller:</p>
  
  <pre><code>  ....
  .state("home", {
          url: "/",
          templateUrl: "views/contactsView.html",
          controller: "contactsController",
           controllerAs: "vm"
      })
      .state("organization", {
          url: "/organization/:Id",
          templateUrl: "views/organizationDetail.html",
          params: { Id: null },
          controller: "organizationsController",
          controllerAs: "vm"
      })
  ...
  </code></pre>
  
  <p>My problem is that I get the data, I see in the console, but when the new URL comes into place, the Data is gone and the view is shown empty.</p>
  
  <p>How could I use the data produced in the factory in the second Controller?</p>
  
  <p>EDIT:</p>
  
  <p>Here are the Controllers:</p>
  
  <pre><code>//organizationsController.js
  (function () {
      "use strict";
      angular.module('appContacts')
          .controller('organizationsController', function organizationsController(dataService) {
  
              var vm = this;
  
              vm.setCurrentOrganization = function (organization) {
                  vm.theOrganization = organization;
                  vm.visible = true;
  
    dataService.getCurrentOrganization(vm.theOrganization.id).then(function (result) {
                      vm.organizationData = result.data;
  
                  }, function () {
                      vm.errorMessage = "Failed to load" + Error;
                  });
              }
      });
  })();
  </code></pre>
  
  <p>And the contactsController:</p>
  
  <pre><code>//contactsController.js
  
  (function () {
      "use strict";
      angular.module('appContacts')
          .controller('contactsController', function contactsController(dataService) {
  
              var vm = this;
              vm.visible = false;
  
              activate();
  
              function activate() {
                  dataService.getAllContacts().then(function (result) {
                      vm.allcontacts = result.data;
                  }, function () {
                      vm.errorMessage = "Failed to load" + Error;
                  });
  
                  dataService.getAllOrganizations().then(function (result) {
                      vm.organizations = result.data;
                  }, function () {
                      vm.errorMessage = "Failed to load" + Error;
                  });
              }
      });
  })();
  </code></pre>
  
  <p>The problem is that I click the llink in the view A (contactsView.html/ContactsViewController) and I should end in the VIEW B (OrganizationDetails.html/organizationController), using the Data fetch in the service.</p>