所以我得到这个错误:
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"
}
}
我尝试将 rootDir
或 sourceRoot
更改为定义为 ../
或 ../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/