title: Factory not keeping data when used in controller
body: <p>I have a factory House</p>
  
  <p>'use strict';</p>
  
  <pre><code>myApp
  .factory('House', [ '$http', '$location', '$rootScope', function($http, $location, $rootScope){
  
      var numberOfDoors;
  
      return {
  
          loadHouse: function(){
             numberOfDoors = 1;
          },
  
          numberOfDoors: numberOfDoors
  
  
      };
  }]);
  </code></pre>
  
  <p>And I have a controller Owner</p>
  
  <pre><code>myApp
  .controller('OwnerCtrl', ['$rootScope', '$scope', '$location', 'House', function($rootScope, $scope, $location, House) {
  
  
      $scope.buildMe = function() {
  
          //use value from house
          var sayHelloToDoors = House.numberOfDoors;
  
      };
  }]);
  </code></pre>
  
  <p>If I run a function <code>House.loadHouse()</code> in some other controller in order to set the variable <code>numberOfDoors</code> - I do set it, but when I switch to a page to reuse that number, I get a <code>undefined</code> message in <code>Owner</code> controller.</p>
  
  <p>Why the value is cleared? It seems like another instance of House is transfered.
  Could anybody help?  </p>