mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
v2: feat(Storage): adds setJson() method
This commit is contained in:
@@ -29,6 +29,13 @@ export class Storage {
|
||||
}
|
||||
});
|
||||
}
|
||||
setJson(key: string, value: any): Promise<any> {
|
||||
try {
|
||||
return this.set(key, JSON.stringify(value));
|
||||
} catch (e) {
|
||||
return Promise.reject(e);
|
||||
}
|
||||
}
|
||||
set(key: string, value: any) {
|
||||
return this._strategy.set(key, value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user