title: Angularjs ngStorage watch localstorage variable in other controller/ browser tab
body: <p>I am using AngularJs and ngStorage to make a shopping cart. I want to keep data in local storage. When I add something from different browser tab I want to call my http method in the cart where cart is opened. I wanted to use $scope.$watch but it is not working :(</p>
  
  <p>I was trying als to use helper value in localstorage, first controller:</p>
  
  <pre><code>$scope.$watch('counter', function(newValue, oldValue) {
      if(newValue === oldValue){
        return;
      }
      console.log(newValue);
  });
  
  $scope.deleteItem = function (item) {
      var index = $scope.storage.products.indexOf(item);
      $scope.storage.products.splice(index, 1);
      $scope.counter = 0;
  }
  </code></pre>
  
  <p>Second Controller:
      $scope.addToCart = function(code) {</p>
  
  <pre><code>    var prod = {
          code: code,
          quantity: 1,
          color: 0,
          notes: '',
      };
      $scope.storage.products.push(prod);
      $scope.storage.counter=$scope.storage.counter+1;
      $scope.$apply();
  }
  </code></pre>
  
  <p>How to observe/watch my localstorage value when it is modified in another browser tab?</p>