Angular 2 - 模块在刷新时加载两次

Angular 2 - module is loaded twice on refresh

我有 ab Angular 2 个应用程序。使用 router-deprecated(因为当前没有记录新路由器)。有两条基本路线(home 和 admin)。 如果我加载应用程序或执行 F5 刷新,当前模块被加载两次(你可以看到 html 文件被请求两次,构造函数也被调用两次。如何防止应用程序加载路由两次? 更改路由不会导致"double loading"。只会导致F5/frist负载

<html>
<head>
<base href= />
<title>Consyd Time Management</title>
<meta charset=UTF-8>
<meta name=viewport content="width=device-width,initial-scale=1">
<link rel=stylesheet href=public/css/styles.css>    
<link rel=stylesheet href=node_modules/bootstrap/dist/css/bootstrap.min.css>
<script src=node_modules/core-js/client/shim.min.js></script>
<script src=node_modules/zone.js/dist/zone.js></script>
<script src=node_modules/reflect-metadata/Reflect.js></script>
<script src=public/scripts/externalLibs.js></script>
</head>
<body>
<div id=main class=container-fluid> <start-page>Loading...</start-page>       </div>   

start.ts

import { Component } from '@angular/core';
import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from     '@angular/router-deprecated';
import { NavigationMenu } from "./navigation";
import { myRoutes } from '../routes';


@Component({
selector: 'start-page',
template: `
<h2>Startseite</h2>
<navigation-menu></navigation-menu>
<router-outlet></router-outlet>`,
directives: [ROUTER_DIRECTIVES, NavigationMenu]
})
@RouteConfig(myRoutes)

export class StartPage {

}

和routes.ts

import { RouteDefinition } from '@angular/router-deprecated';
import { HomePage } from './views/home';
import { AdminPage} from './views/adminpage';


export const myRoutes: RouteDefinition[] = [
    {
        path: '/',
        name: 'Home',
        component: HomePage
    },
    {
        path: '/admin',
        name: 'Admin',
        component: AdminPage

    }
];

home.ts

//imports going here
@Component({
    selector: 'start-page',
    templateUrl: 'public/app/html/home.html',
    directives: [DROPDOWN_DIRECTIVES, CORE_DIRECTIVES],
    providers: [HttpService]
})

export class HomePage {
    constructor(private httpService: HttpService) {
        if (!this.selectedProject) {
            this.selectedProject = new Project("Projekt auswählen");
        }
        this.getUsers(this.setUser);

    }
//REST OF CODE  

已关闭:在 index.html 中添加了两次 externallibs.js(一次手动,一次通过 webpack)....