【问题标题】:ngRoute not working when page reload页面重新加载时ngRoute不起作用
【发布时间】:2017-11-11 09:37:48
【问题描述】:

我在我的应用程序中使用 ngRoute。问题是当我重新加载该页面时,出现错误。 错误说 白标错误页面 此应用程序没有显式映射 /error,因此您将其视为后备。

    var app = angular.module('myApp',['ngTable','jcs-autoValidate','ngRoute']);

// configure our routes
app.config(function($routeProvider,$locationProvider) {
    $routeProvider
        .when('/container-details', {
            templateUrl : 'container-details-test.jsp',
            controller  : 'myCtrl'

        })

    $locationProvider.html5Mode(true);
});

【问题讨论】:

  • 您必须在使用 HTML5 模式的服务器配置中添加一些重写规则。

标签: javascript angularjs ngroute


【解决方案1】:
猜你喜欢
  • 2015-02-16
  • 2017-11-03
  • 1970-01-01
  • 2011-09-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-06-21
相关资源
最近更新 更多