Angular Nativescript:组件拆分导致无法读取属性中出错';0';未定义的
我有一个LoginComponent,我想为web和mobile拆分它。一旦我克隆并创建login.component.tns.ts并运行tns build android--bundle,我就会遇到以下错误Angular Nativescript:组件拆分导致无法读取属性中出错';0';未定义的,angular,nativescript,angular2-nativescript,Angular,Nativescript,Angular2 Nativescript,我有一个LoginComponent,我想为web和mobile拆分它。一旦我克隆并创建login.component.tns.ts并运行tns build android--bundle,我就会遇到以下错误 Entrypoint bundle = runtime.js vendor.js bundle.js [./app.css] 1.2 KiB {bundle} [built] [./main.tns.ts] 1.13 KiB {bundle} [built] [~/package.json
Entrypoint bundle = runtime.js vendor.js bundle.js
[./app.css] 1.2 KiB {bundle} [built]
[./main.tns.ts] 1.13 KiB {bundle} [built]
[~/package.json] external "~/package.json" 42 bytes {bundle} [optional] [built]
+ 327 hidden modules
ERROR in Cannot read property '0' of undefined
Webpack compilation complete.
Executing webpack failed with exit code 2.
如果删除login.component.tns.ts文件,构建工作正常。这里有什么指示吗
app/tsconfig.app.json
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"types": [
"node"
],
"paths": {
"@src/*": [
"src/*.web",
"src/*"
]
}
},
"exclude": [
"test.ts",
"**/*.spec.ts"
],
"files": [
"src/main.ts",
"src/polyfills.ts"
]
}
tsconfig.tns.json(不在应用程序文件夹内,但在项目文件夹内)
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "node",
"experimentalDecorators": true,
"skipLibCheck": true,
"baseUrl": ".",
"paths": {
"@src/*": [
"src/*.tns.ts",
"src/*.ts"
]
}
},
"files": [
"src/main.tns.ts"
]
}