I have a form on submit of the form I am receiving the json object after form submit. What I am trying is that I have a file data.json in my application folder in "/src/app/data.json". How can I write the data into the JSON file with Node.
Below is my code
Below is the code in my component.ts
savedatatojson(jsonobject){
// jsonobject is the json data
this.dataservice.savedata(jsonobject).subscribe(data => {
console.log(this.data)
})
}
Below is the code in my service file
public savedata(jsonobject):Observable<any>{
//code to be written
}
How do I save data to json file which I have obtained in my service file