AngularJs:处理两个水疗中心和routeProvider

AngularJs:处理两个水疗中心和routeProvider,angularjs,single-page-application,Angularjs,Single Page Application,我有两个水疗中心:一个有,另一个有 我将这些应用程序作为单独的war文件部署在tomcat服务器中。到目前为止,这是工作良好 让我们看看我的代码(第二个应用程序配置,即/dashboard/): 问题#1 正如您在代码中看到的,我想重定向URLhttp://localhost/dashboard至http://localhost/dashboard/events默认情况下,。但此配置在浏览器控制台中给了我超过最大调用堆栈的错误 问题#2 我的第一个应用程序中已经有404页,即http://loc

我有两个水疗中心:一个有
,另一个有

我将这些应用程序作为单独的
war
文件部署在tomcat服务器中。到目前为止,这是工作良好

让我们看看我的代码(第二个应用程序配置,即/dashboard/):

问题#1

正如您在代码中看到的,我想重定向URL
http://localhost/dashboard
http://localhost/dashboard/events默认情况下,
。但此配置在浏览器控制台中给了我超过最大调用堆栈的错误

问题#2

我的第一个应用程序中已经有404页,即
http://localhost/404
位置。但我当前的配置将我重定向到
http://localhost/dashboard/404
。我想重新使用我的404页面


请把我引向正确的方向。谢谢。

第二个问题可能是因为您一次只运行一个水疗中心。这就是仪表板。localhost一次只能在一个端口上承载一个应用程序。那可能是仪表板。试着杀掉一个仪表板,运行另一个,然后试试这个404页面。@Shivi,我不能杀掉非仪表板应用程序,因为两者同时运行。考虑到这一点,它们部署在生产中,我想使用<代码>http://localhost/404url。
myApp.config(['$routeProvider','$locationProvider', function($routeProvider, $locationProvider) {
    $locationProvider.html5Mode(true);

    $routeProvider.when('/events', {
        templateUrl: 'event-list/event-list.html',
        controller: 'eventListCtrl'
    });

    $routeProvider.when('/', {
        templateUrl: ' ',
        controller: ['$scope','$location', function($scope,$location) {
            $location.path('events');
            $location.replace(); // problem #1
        }]
    });

    $routeProvider.otherwise({redirectTo: '/404'}); // problem #2
}]);