How to keep localStorage values after refresh?

后端 未结 6 750
挽巷
挽巷 2020-12-19 15:09

This is my ctrl:

app.controller(\'ctrl\', function ($window, $scope) {

    $scope.initData = [
        {
            firstName: \"John\",
            lastNa         


        
6条回答
  •  醉梦人生
    2020-12-19 15:33

    In Simple Steps in matters how you need your page to refresh using afunction to refresh comes handy and effective for me and keeps the locaStorage values set.. i used.... the function below by calling it as load() and it worked for me

        function load()
    {
      console.log("loading")
      setTimeout("window.location.assign('samepage.html');", 1000);
    
    }
    

提交回复
热议问题