title: Add 'n' items to local storage (items are getting from json file)
body: <p>I'm getting info from a json file, and i need to store some items on local storage. </p>
  
  <p>This is my code to get the data from json file:</p>
  
  <pre><code>    $scope.selection = "Selecciona una categoría";
  
      $scope.filterAvailable = function(available){
          var filteringBy = [];
  
          $http.get('/app/json/file.json')
          .then(function(data){
              $scope.listOfProducts = data.data.products;
  
                  for(var i = 0; i&lt; $scope.listOfProducts.length; i++){
                      if($scope.listOfProducts[i].available === true &amp;&amp; $scope.listOfProducts[i].sublevel_id === $scope.inside){
                          filteringBy.push($scope.listOfProducts[i]);
                      }
                  }
  
                  $scope.dataOnFilter = filteringBy;
          });
      }
  </code></pre>
  
  <p>And with a ng-repeat, i show the info on my html view:</p>
  
  <pre><code>&lt;ul&gt;
     &lt;li ng-repeat="data in dataOnFilter"&gt;&lt;a ng-click="selected(data)"&gt;{{data.name}}&lt;/a&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Then, i catch the specific value and save on local storage by clicking on the <code>&lt;a&gt;</code> tag with the next piece of code:</p>
  
  <pre><code>    $scope.selected = function(y){
          $scope.dataAdd = y;
  
          localStorage.setItem('valid', JSON.stringify($scope.dataAdd));
      }
  </code></pre>
  
  <p>If i want to see the selected info on a modal, just have to click on another button:</p>
  
  <pre><code>    $scope.openCart = function(){
          $scope.myItems = JSON.parse(localStorage.getItem('valid'));
  
          $('#cart').modal({
              show: true
          });
      }
  </code></pre>
  
  <p>Everything is perfect if i select one item, but, if i choose another, the info are rewrited. What i need is store all the selected items in the local storage.</p>
  
  <p>Someone can help me, please?</p>
  
  <p>I'm using AngularJs and Javascript.</p>