Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 如果几分钟不使用(当页面空闲几分钟时),我的角度页面会卡住(路由不工作)_Angularjs_Angular Ui Router - Fatal编程技术网

Angularjs 如果几分钟不使用(当页面空闲几分钟时),我的角度页面会卡住(路由不工作)

Angularjs 如果几分钟不使用(当页面空闲几分钟时),我的角度页面会卡住(路由不工作),angularjs,angular-ui-router,Angularjs,Angular Ui Router,我正在为我的单页应用程序使用Angular UI路由器。它基本上是报表(网格+图表)。当我从一个页面转到另一个页面时,它是好的。但若我打开页面,像那个样保持几分钟,然后再次尝试通过点击链接转到另一个页面,那个么它就被卡住了。然后我必须刷新页面 这意味着,如果页面闲置几分钟,那么路由就不会按应有的方式进行 (function () { var module = angular.module("app", ["ngAnimate", "ui.router", "ui.bootstr

我正在为我的单页应用程序使用Angular UI路由器。它基本上是报表(网格+图表)。当我从一个页面转到另一个页面时,它是好的。但若我打开页面,像那个样保持几分钟,然后再次尝试通过点击链接转到另一个页面,那个么它就被卡住了。然后我必须刷新页面

这意味着,如果页面闲置几分钟,那么路由就不会按应有的方式进行

    (function () {

    var module = angular.module("app", ["ngAnimate", "ui.router", "ui.bootstrap"]);
    module.config(function ($stateProvider, $urlRouterProvider) {

      $urlRouterProvider.otherwise("/error");

      $stateProvider
      .state('home', {
        url: "/",
        templateUrl: "partials/index.html",
        controller: "indexController",
        controllerAs: "ctrl"
      })
      .state('weather', {
        url: "/weather",
        templateUrl: "./partials/weather.html",
        controller: "weatherController",
        controllerAs: "ctrl"
      })
      .state('error', {
        url: "/error",
        templateUrl: "/partials/error.html"
      })
      .state('horizontalBar', {
        url: "/horizontalBar",
        templateUrl: "./partials/charts/d3/horizontalBar.html",
        controller: "horizontalBarController",
        controllerAs: "ctrl"
      })
      .state('lineChart', {
        url: "/lineChart",
        templateUrl: "./partials/charts/d3/lineChart.html",
        controller: "lineChartController",
        controllerAs: "ctrl"
      });

    });  
}());