netbeans - app.component.ts 不在 tsconfig.json 定义的项目中

标签 netbeans angular typescript

所以我得到这个错误:

File C:/wamp/www/angular2_demo/GiphySearch/src/app/app.component.ts is not in project defined by C:/wamp/www/angular2_demo/GiphySearch/e2e/tsconfig.json

我的文件夹结构是

/
/e2e/tsconfig.json
/src
(others)

tsconfig.js 有此内容

{
  "compileOnSave": false,
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "mapRoot": "",
    "module": "commonjs",
    "moduleResolution": "node",
    "noEmitOnError": true,
    "noImplicitAny": false,
    "rootDir": ".",
    "sourceMap": true,
    "sourceRoot": "/",
    "target": "es5"
  }
}

我尝试将 rootDirsourceRoot 更改为定义为 ../../src/src 但没有任何效果。应该如何正确配置?

最佳答案

NetBeans 项目可能设置为将整个 ng2-cli 目录索引为单个源根目录,这会破坏此插件,因为其下有多个 tsconfig.json 文件(一个在 src/中,一个在 e2e/中) )。

在项目属性中的“源”类别下,将“站点根文件夹”和“源文件夹”设置为 src。 (如果您也想编辑“Selenium 测试文件夹”,也可以将其设置为 e2e)。

关于netbeans - app.component.ts 不在 tsconfig.json 定义的项目中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39036824/

相关文章:

typescript - 如何将 VS Code 的大纲同步到编辑器中的当前位置

typescript - 我可以为以编​​程方式生成的 TypeScript 接口(interface)/类型的键添加前缀或后缀吗?

Netbeans 为每个项目创建一个新窗口

java - 我们如何将 JML (openJML) 应用于 Java 代码?

Angular2 ngModel 选择 - 处理一个对象

javascript - typescript 泛型 : Use output argument type to build input argument type

java - 无法在 Jpanel 上显示图像

Eclipse 与 Netbeans 基准测试

javascript - 在 JavaScript 中,如何按 asc/desc 对数组数组进行排序

javascript - 如何在 Nodejs REPL 中使用 Typescript 类?