Visual studio 找不到符号';组件';

Visual studio 找不到符号';组件';,visual-studio,reference,gruntjs,typescript,grunt-ts,Visual Studio,Reference,Gruntjs,Typescript,Grunt Ts,我在3个单独的文件夹中有3个模块,每个(测试方面)有一个文件: 组件/页面列表.ts 指令/testDirective.ts entity1/entity1.ts 哪个近似值看起来像这样 // pagedList.ts module App.Components { export interface IPagedList<T> { ... } } // testDirective.ts module App.Directives { ex

我在3个单独的文件夹中有3个模块,每个(测试方面)有一个文件:

  • 组件/页面列表.ts
  • 指令/testDirective.ts
  • entity1/entity1.ts
哪个近似值看起来像这样

// pagedList.ts
module App.Components {
    export interface IPagedList<T> {
        ...
    }
}

// testDirective.ts
module App.Directives {
    export class TestDirective {
        ...
    }
}

// entity1.ts
module App.Entity1 {
    export interface IEntity1 {
        ...
    }
}

之所以会出现这种情况,是因为
App.Components
是所谓的未实例化模块。因为其中只有一个接口,编译器只在类型名称空间中创建一个符号,而不在运行时创建任何值

一旦
组件
中有一个类、变量或实例化模块,您就会看到错误消失了。如果同时需要,您可以在这里输入一个虚拟的非导出变量

var dependencies = [
    "ui.router", 
    "ui.bootstrap",
    Components, // Unable to find symbol 'Components'
    Directives,
    Entity1,
];