为什么我会收到重复的类(或标识符)错误?

时间:2016-04-13 16:14:52

标签: typescript typescript1.8

为什么我收到此类重复错误?

enter image description here

下面的源代码。

[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();

1 个答案:

答案 0 :(得分:1)

您必须从编译中排除d.ts文件。您可以通过添加排除数组并添加d.ts

的路径在tsconfig中执行此操作