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訪問它 –