9

ページが更新されたときに、sessionStorage から検索データとフィルター データを取得しようとしています。

sessionStorage.restorestate は undefined を返しますが、その理由を知っている人はいますか?

app.run(function($rootScope) {
    $rootScope.$on("$routeChangeStart", function(event, next, current) {
      if (sessionStorage.restorestate == "true") {
        $rootScope.$broadcast('restorestate'); //let everything know we need to restore state
        sessionStorage.restorestate = false;
      }
    });

    //let everthing know that we need to save state now.
    window.onbeforeunload = function(event) {
      $rootScope.$broadcast('savestate');
    };
  });

プランク: http://plnkr.co/edit/oX4zygwB0bDpIcmGFgYr?p=preview

4

1 に答える 1