Im trying to make a local app, for myself and save everything in json localy. i have this Posts Interface and array with data build up:
this.p = [{
posts:{
id: 'hey man',
title: 'awdwada',
description: 'awdawdaw',
commands: {
title: 'dawdawdawd',
description: 'awdawda',
note: 'wadadaw',
}
}
}
];
const r = JSON.stringify(this.p);
console.log(r);
how can i save this into a json file?
posting()
{
this.http.post<any>(this.baseurl).map(res:Response=>{res.json();});
}
ngOnInit()
{
this.appService.posting().subscribe(data=>this.p=data);
}
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.