The file performs.json
contains an JSON array with objects of user info.
I want to programmatically update this array and save again. But I don't know how.
$http.get('db/performs.json')
.then(function (res) {
res.data.push(newSubmit);
// Save this new res.data to db/performs.json
});
When you call $http.get
the server sends the file to you, it is then placed in memory, which you then modify. At this point you need to send the modified file back to the server for storage.
This needs to be supported by the server that served the file initially.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.