You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i have this issue too
i use angular and iframes on one page, and all pages use local storage, and this error always happens
there is some event come from angular into ngstorage and its value starts with _
but if its just one app page with no iframes, everything is fine
I have the same problem and I think that's because some parts of the application don't store JSON serialized values in the localStorage and ngStorage tries to deserialize every value as JSON (
I think you could try to set your own deserializer which catches these errors:
var deserializer = function (value) {
try {
return JSON.parse(value);
} catch (err) {
// We expect that the error is a JSON parsing error.
return value;
}
};
Hi!
Got alot of error messages in console when using this module:
Uncaught SyntaxError: Unexpected token _ in JSON at position 0(…) ngStorage.js:220
event.newValue ? $storage[event.key.slice(prefixLength)] = deserializer(event.newValue) : delete $storage[event.key.slice(prefixLength)];
Changed to
event.newValue && !angular.isUndefined($storage[event.key.slice(prefixLength)]) ? $storage[event.key.slice(prefixLength)] = deserializer(event.newValue) : delete $storage[event.key.slice(prefixLength)];
Now there's no error messages :)
The text was updated successfully, but these errors were encountered: