1

I do not have any database connection and I have created localhost using http-server -o. -o

I want to store form data in the localhost that I have created.

$scope.sendData = function() {
$http({
      url: 'local-host://8080',
      method: "POST",
      data: { $scope.users }
}).success(function(response){
   alert("data stored successfully");
});
}
Venkat
  • 11
  • 1
  • https://stackoverflow.com/questions/22811160/store-data-locally-using-html-and-javascript?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa – Anil Arya Apr 01 '18 at 11:51

2 Answers2

0

you can use localStorage to store form data like

$scope.sendData = function() {
$http({
      url: 'local-host://8080',
      method: "POST",
      data: { $scope.users }
}).success(function(response){
   localStorage.setItem('response', response);
   alert("data stored successfully");
});
}
0

You can use following plugin

https://www.npmjs.com/package/json-server

npm i json-server

Nathash
  • 61
  • 3