I'm facing an issue with the following code snippet:
var a = localStorageService.get('selectedQuestionSortOrder');
$scope.selectedQuestionOrderBy = JSON.parse(a);
var b = 99;
Upon inspecting with a debugger, I observe the following:
a
-
Object
key: "questionStatusId"
label: "status"
However, when I run the second line of code, I encounter the error message:
SyntaxError: Unexpected token o
at Object.parse (native)
at new <anonymous> (http://127.0.0.1:81/Content/app/admin/controllers/question-controller.js:71:47)
at d (http://127.0.0.1:81/Scripts/angular-v1.1.5.min.js:28:304)
at Object.instantiate (http://127.0.0.1:81/Scripts/angular-v1.1.5.min.js:28:434)
at $get (http://127.0.0.1:81/Scripts/angular-v1.1.5.min.js:53:326)
at http://127.0.0.1:81/Scripts/angular-v1.1.5.min.js:44:274
at n (http://127.0.0.1:81/Scripts/angular-v1.1.5.min.js:7:74)
at k (http://127.0.0.1:81/Scripts/angular-v1.1.5.min.js:44:139)
at e (http://127.0.0.1:81/Scripts/angular-v1.1.5.min.js:40:139)
at http://127.0.0.1:81/Scripts/angular-v1.1.5.min.js:39:205
I would appreciate any insights or advice on what could be causing this issue.