title: Can't display JSON-objects from session-storage in AngularJS
body: <p>I'm having problem displaying a JSON-object named "currentSet" from session-storage. When I instead use a JSON-file from a folder everything works fine, which means the HTML-code is probably fine. I have narrowed the problem down to either the $scope.set or the loadQuiz-function and have tried several things, but can't get it to work. This is the relevant parts from the controller:</p>
  
  <pre><code>    $scope.set = angular.fromJson(sessionStorage.getItem('currentSet')); //doesn't work
      //$scope.set = 'data/konflikter.js'; //works
  
      $scope.defaultConfig = {
          'autoMove': true,
          'pageSize': 1,
          'showPager': false
      }
  
      $scope.onSelect = function (question, choice) {
            question.choices.forEach(function (element, index, array) {
              question.Answered = choice;
            });
  
          if ($scope.defaultConfig.autoMove == true &amp;&amp; $scope.currentPage &lt; $scope.totalItems) {
              $scope.currentPage++;
          }
          else {
              $scope.onSubmit();
          }
      }
  
      $scope.onSubmit = function () {
          var answers = [];
          $scope.questions.forEach(function (question, index) {
              answers.push({'questionid': question._id, 'answer': question.Answered});
          });
          $http.post('https://fhsclassroom.mybluemix.net/api/quiz/submit', answers).success(function (data, status) {
              $location.path('/');
          });
      }
  
      $scope.pageCount = function () {
          return Math.ceil($scope.questions.length / $scope.itemsPerPage);
      };
  
      $scope.loadQuiz = function (data) {
          $http.get(data)
           .then(function (res) {
               $scope.name = res.data.name;
               $scope.questions = res.data.questions;
               $scope.totalItems = $scope.questions.length;
               $scope.itemsPerPage = $scope.defaultConfig.pageSize;
               $scope.currentPage = 1;
  
               $scope.$watch('currentPage + itemsPerPage', function () {
                   var begin = (($scope.currentPage - 1) * $scope.itemsPerPage),
                     end = begin + $scope.itemsPerPage;
  
                   $scope.filteredQuestions = $scope.questions.slice(begin, end);
               });
           });
      }
      $scope.loadQuiz($scope.set);
  </code></pre>