Reputation: 271
If I have a JSON file that contains a key, "text", and has an empty value how can I update the empty value?
I am using angularjs to make it interact with the user. I am also using $http.get to retrieve the json file. I am able to save the text to localstorage but I am having trouble sending the localstorage value into the JSON file. Overall I want the user to refresh the page and the text to still be there.
This is just a general overview of what I want to do which is why I am not providing code. All I want to do is figure out how, if possible, to update the JSON file so that next time it is refreshed and the $http.get is called again, the key has an updated value and it is displayed.
Upvotes: 0
Views: 197
Reputation: 78
The basic step is to write a server side script (in perl/python/php etc) and then do an http post request from your AngularJS and your script updates the file in question. This is a good link to understand how to do it in python http://www.pythonschool.net/server-side-scripting/introduction-to-server-side-scripting/
Upvotes: 2