Im getting following error when I add localStorage.setItem("lastname", "Smith"); line to the controller.
Error: Unspecified error. at $scope.singleSg (file:///C:/ashwitha%20G%20S/sugg/js/controller.js:28:21) at fn (Function code:2:296) at expensiveCheckFn (file:///C:/ashwitha%20G%20S/sugg/lib/angular.js:15906:11) at callback (file:///C:/ashwitha%20G%20S/sugg/lib/angular.js:25885:17)
at Scope.prototype.$eval (file:///C:/ashwitha%20G%20S/sugg/lib/angular.js:17682:9) at Scope.prototype.$apply (file:///C:/ashwitha%20G%20S/sugg/lib/angular.js:17782:13) at Anonymous function (file:///C:/ashwitha%20G%20S/sugg/lib/angular.js:25890:17) at n.event.dispatch (https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js:3:12312) at r.handle (https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js:3:9090)
.controller('sgController', function ($scope, $state, loginOperation) {
loginOperation.suggestion().success(function (recData) {
if (recData) {
//console.log(recData);
$scope.suggestions = recData;
$scope.singleSg = function (index) {
console.log(index);
localStorage.setItem("lastname", "Smith");
$state.go('sugRm');
}
}
}).error(function () {
console.log("Request failed");
});
})