“exception:t实例化时出错! 主要sockets已经注册。“在cordova angular2应用程序

我正在用我的项目构build一个简单的cordova应用程序。 它有两层嵌套(主要路线) – >小孩路线 – >(另一个小孩路线)。 When trying to browse to the 2nd level (another child route)我得到一个错误, Exception: Error during instantiation of t! Primary outlet already registered. Exception: Error during instantiation of t! Primary outlet already registered. 一级工作正常。 我没有在任何模板中使用两次路由器sockets。 在模拟浏览器以及android的时候,问题都是一样的。

在下面附上铬检查。

在这里输入图像说明

我的HTML文件

 <html> <head> <base href="./"> <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *"> <meta name="format-detection" content="telephone=no"> <meta name="msapplication-tap-highlight" content="no"> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width"> <link rel="stylesheet" type="text/css" href="css/index.css"> <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <link href="assets/css/style.css" rel="stylesheet" type="text/css" /> <link href="assets/css/skins/skin-white.css" rel="stylesheet" type="text/css" /> <title>Hello World</title> </head> <body> <main-app> <div class="app"> <h1>Apache Cordova</h1> <div id="deviceready" class="blink"> <p class="event listening">Connecting to Device</p> </div> </div> </main-app> <head> <!-- 1. Load libraries --> <!-- IE required polyfills, in this exact order --> <script src="js/angulardeps/2.0.0-beta.9/shims_for_IE.js"></script> <script src="js/angulardeps/2.0.0-beta.9/es6-shim.min.js"></script> <script src="js/angulardeps/2.0.0-beta.9/system-polyfills.js"></script> <script src="js/angulardeps/2.0.0-beta.9/angular2-polyfills.js"></script> <script src="js/angulardeps/2.0.0-beta.9/system.js"></script> <script src="js/angulardeps/2.0.0-beta.9/Rx.js"></script> <script src="js/angulardeps/2.0.0-beta.9/angular2.dev.js"></script> <script src="js/angulardeps/2.0.0-beta.9/router.min.js"></script> <script src="js/angulardeps/2.0.0-beta.9/http.min.js"></script> <script src="assets/plugins/jQuery/jQuery-2.1.4.min.js" type="text/javascript"></script> <script src="assets/js/bootstrap.min.js" type="text/javascript"></script> <script type="text/javascript" src="cordova.js"></script> <script type="text/javascript" src="js/index.js"></script> </body> 

我的构build源码结构: 在这里输入图像说明

我的主要部分:

 import {Component} from 'angular2/core'; import {ApproutesComponent} from '../app/approutes'; import {ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router'; @RouteConfig([ {path: '/d/...', component: ApproutesComponent, name: 'ApproutesCmp', useAsDefault:true} ]) @Component({ selector: 'main-app', templateUrl: 'app/r/main/rmain.html', directives:[ROUTER_DIRECTIVES] }) export class RroutesComponent { constructor(){} } 

Solutions Collecting From Web of "“exception:t实例化时出错! 主要sockets已经注册。“在cordova angular2应用程序"