title: data is lost after page refresh from local storage
body: <p>i am storing user info into local storage, but every time i reload the page data is lost. not getting the exact solution. Here is my js code. i am getting value for user object from html in this format</p>
  
  <pre><code>    {"fname":"A","lname":"B","age":"12","email":"a@b.com","class":"6","password":"1234"}
  </code></pre>
  
  <p>here is my js code</p>
  
  <pre><code>    var app = angular.module("myApp",["ngStorage"]);
  
     app.controller("myCtrl", function($scope,$localStorage,
       $sessionStorage) {
       var usersinfo= [];
       $scope.submit = function() {
         usersinfo.push($scope.user);
         localStorage.setItem("usersinfo", JSON.stringify(usersinfo));
  
        console.log(usersinfo);    
       };   
  
  });
  </code></pre>