当我在浏览器中运行我的应用程序(离子服务-l)一切都很好,即使在大多数Android设备上都没有问题,但我发现一些不会启动应用程序并在设备上出错时死亡。我在android 5.0.2上运行有问题。我甚至试图在tsconfig.json中关闭严格模式,但没有成功。有人遇到类似的问题,或者有什么方法可以找出问题究竟在哪里?
tsconfig.json
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"diagnostics": true,
"allowUnreachableCode": true,
"noImplicitUseStrict": true,
"lib": [
"dom",
"es2015"
],
"module": "es2015",
"moduleResolution": "node",
"sourceMap": true,
"target": "es5"
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
],
"compileOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}
答案 0 :(得分:0)
您可以使用所有这些选项来配置严格的类型检查:
/* Strict Type-Checking Options */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"strictNullChecks": true, /* Enable strict null checks. */
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
请注意,TypeScript 2.3中添加了“严格”配置