title: Store data between controllers as uique
body: <p>I have a controller which, I have expected, will contain unique data, gather as follow:</p>
  
  <pre><code>        setInterval(function() {
  
              dataStorage.setData('maxTime',maxTime);
              dataStorage.setData('currentTime',currentTime);
              dataStorage.setData('previousTime',previousTime);
  
              var dMaxTime = dataStorage.getData('maxTime');
              var dCurrentTime = dataStorage.getData('currentTime');
              var dPreviousTime = dataStorage.getData('previousTime');
  
              $log.debug("Max time  " + dMaxTime);
              $log.debug("Current time " + dCurrentTime);
              $log.debug("Previous time " + dPreviousTime)
  
          }, 2000);   
  </code></pre>
  
  <p>which uses simple factory to capture data between controllers</p>
  
  <pre><code>myApp.factory('dataStorage', [function() {
  
      var dataInfo = [];
  
      return {
  
          setData: function (key, data) {
              dataInfo[key] = data;
          },
          getData: function (key) {
              return dataInfo[key];
          }
  
      };
  }]);
  </code></pre>
  
  <p>but when I go back and forth to the view which has first code above it stores the same variables again but with different (updated values) and then displays them in the log as how many times that view with controller was hit.</p>
  
  <p>Is there any way to prevent that and to have stored only most recent captured data?</p>