In component.ts I used ,
when click on the save button I want to overwrite the existing json1 file from the server. I there any solution for this ?? Thanks in advance..
Alternatively if this is a learning project, you might want to save (with angular) to localStorage of the browser. And on load, first check if there's data in localStorage before going to backend directly. But this is limited on one user alone, and even that just until the browser wipes the storage.
Not with angular alone. What you can do is pick up the changes on button click, and send those changes (or the whole new JSON) to a server that can write to files. So if your backend server is something like nginx, apache or "ng serve", you can't write that change. But if you have a Node.js, PHP, Java or something like that, you can overwrite the data.
Alternatively if this is a learning project, you might want to save (with angular) to localStorage of the browser. And on load, first check if there's data in localStorage before going to backend directly. But this is limited on one user alone, and even that just until the browser wipes the storage.
--
You received this message because you are subscribed to a topic in the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/Qa3Xr95g24I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+unsubscribe@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.