title: Cannot read property 'splice' of undefined
body: <p>I'm trying to remove the item from the localstorage json data. but have error in my console 'splice' undefined. Please Help Me..</p>
  
  <p><strong>This is my Controller</strong></p>
  
  <pre><code>app.controller('favgame', function($scope, $localStorage){
      $scope.saved = localStorage.getItem('favgame');
      var favgames = JSON.parse($scope.saved);
      $scope.onItemDelete = function(index) {
        $scope.favgames.splice(favgames[index],1);
      };
  });
  </code></pre>
  
  <p><strong>This is my ng-click code</strong></p>
  
  <pre><code>&lt;ion-delete-button class="button button-clear ion-minus-circled" ng-click="onItemDelete($index)"&gt;
  &lt;/ion-delete-button&gt;
  </code></pre>
  
  <p>Thank You!</p>