为什么我收到此类重复错误?
下面的源代码。
[Sigin.html]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title></title>
<script type="text/javascript" src="scripts/web/public/signin/WebpageLoader.js"></script>
</head>
<body>
<WebBody></WebBody>
</body>
</html>
[WebpageLoader.ts]
/// <reference path="../../../../../typings/main/ambient/systemjs/index.d.ts" />
'use strict';
//import System = require("systemjs");
class WebpageLoader {
public constructor() {
window.onload = () => {
//====================================================
//Notice: This is the javascript component that bootstrap Angular 2, to get it up and going...
//====================================================
System.config({
baseURL: "/lib",
defaultJSExtensions: true
});
System.import('/scripts/web/public/signin/WebpageLoaderComponent');
//====================================================
};
}
}
var webpageLoader = new WebpageLoader();
答案 0 :(得分:1)
您必须从编译中排除d.ts文件。您可以通过添加排除数组并添加d.ts
的路径在tsconfig中执行此操作