From eef801f1ae5e0515228f124acd795529c10c1ead Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 5 Nov 2015 17:58:29 -0800 Subject: [PATCH] [Persistence] Fix read in example Values are stored in the scratchpad as JSON, so parse them as JSON before returning them. --- example/scratchpad/src/ScratchPersistenceProvider.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/example/scratchpad/src/ScratchPersistenceProvider.js b/example/scratchpad/src/ScratchPersistenceProvider.js index fac897876b..b45da31e5f 100644 --- a/example/scratchpad/src/ScratchPersistenceProvider.js +++ b/example/scratchpad/src/ScratchPersistenceProvider.js @@ -58,8 +58,10 @@ define( }; ScratchPersistenceProvider.prototype.readObject = function (space, key) { - return this.$q - .when(space === 'scratch' ? this.table[key] : undefined); + return this.$q.when( + (space === 'scratch' && this.table[key]) ? + JSON.parse(this.table[key]) : undefined + ); }; ScratchPersistenceProvider.prototype.deleteObject = function (space, key, value) {