Parth Atara

Parth Atara

  • 2k
  • 27
  • 7.7k

How to form data save in local Storage using Angular JS.

Sep 20 2021 5:02 AM

How to store form data in a local store and how to return data from a local store to a form.

My Local Storage Code :

 

                //

                $scope.Submit = function () {

                    console.log("users" + self.users);

                    // self.users.push(self.users);

                    localStorage.setItem("Users", JSON.stringify(self.user));

 

                }


 

                if (localStorage.getItem('Users') != null) {

                    $scope.users = JSON.parse(localStorage.getItem("Users"));

                    console.log("users" + (localStorage.getItem("Users")));

                }

                //


Attachment: 1-local.zip

Answers (1)