0
我正在使用angular2,当我点击保存按钮时,我想将智能表内容添加到新的json文件中。可能吗 ?保存单击按钮时的智能表内容
source: LocalDataSource = new LocalDataSource();
constructor(private http : Http){
this.http.get('http://192.168.0.100:8000/json1')
.map(response => response.json())
.subscribe(data =>{ this.obj = data
this.source.load(this.obj);});
}
SaveData()
{
alert(JSON.stringify(this.Cost));
// this is function which will active when the save button is pressed.
}
当点击保存按钮我要覆盖从服务器现有json1文件。我有任何解决方案? 在此先感谢
谢谢你的时间。我使用LUA服务器端脚本语言来完成这个过程。如何将对象发布到LUA 我使用过:this.http.post('http://192.168.0.100:80/login/save.lua',JSON.stringify(this.Cost))。这是对的吗 ??但我无法从lua访问它 –