Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 获取ionic 2后编辑并存储json_Angularjs_Json_Ionic2 - Fatal编程技术网

Angularjs 获取ionic 2后编辑并存储json

Angularjs 获取ionic 2后编辑并存储json,angularjs,json,ionic2,Angularjs,Json,Ionic2,我通过以下方式获取json: this.http.get('http://someaddress.json') .map(res => res.json()) .subscribe( data => { ... } ); 现在我想更改一些数据并将其存储在本地,然后我想读取存储的数据。 这样做的最佳实践是什么 constructor(public storage: Storage){} save(){ this.http.get('http://someaddress.j

我通过以下方式获取json:

this.http.get('http://someaddress.json')
.map(res => res.json())
.subscribe(
    data => { ... }
);
现在我想更改一些数据并将其存储在本地,然后我想读取存储的数据。 这样做的最佳实践是什么

constructor(public storage: Storage){}
save(){
  this.http.get('http://someaddress.json').map(res => res.json())
  .subscribe(data => { this.storage.set('address',data) });
}
//像这样使用它

this.storage.get('address');

您可以使用
存储
无json示例。。。