0

当尝试运行“node_modules/.bin/ngc”-p tsconfig-aot.json (这是 NGC 命令来编译 AoT 应用程序)时,我收到以下错误,并且不明白为什么它们会被吐出。

$ "node_modules/.bin/ngc" -p tsconfig-aot.json
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/app.component.ts:15:11: Parameter 'theme' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/navmenu.component.ts:14:11: Parameter 'theme' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/edit.dashboard.general.ts:135:23: Parameter 'message' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/edit.dashboard.general.ts:140:32: Parameter 'index' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/edit.dashboard.general.ts:199:10: Parameter 'type' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/edit.dashboard.general.ts:204:23: Parameter 'message' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/edit.dashboard.general.ts:241:23: Parameter 'message' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/edit.dashboard.custom.ts:39:23: Parameter 'message' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/edit.dashboard.custom.ts:93:23: Parameter 'message' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/edit.dashboard.dynamic.ts:47:23: Parameter 'message' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/edit.dashboard.dynamic.ts:122:23: Parameter 'message' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/edit.dashboard.dynamic.ts:156:18: Parameter 'selectedType' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/edit.dashboard.message.ts:39:23: Parameter 'message' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/edit.dashboard.message.ts:92:23: Parameter 'message' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/edit.dashboard.security.ts:28:23: Parameter 'message' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/edit.dashboard.security.ts:110:23: Parameter 'message' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/edit.dashboard.security.ts:140:23: Parameter 'message' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/admin.dashboard.component.ts:102:23: Parameter 'message' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/admin.dashboard.component.ts:119:23: Parameter 'message' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/user.dashboard.component.ts:71:64: Parameter 'a' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/user.dashboard.component.ts:71:67: Parameter 'b' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/src/app/save.dashboard.component.ts:134:23: Parameter 'message' implicitly has an 'any' type.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/admin.dashboard.component.ngfactory.ts:191:43: Property 'newDashboard' is private and only accessible within class 'AdminDashboardComponent'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/admin.dashboard.component.ngfactory.ts:319:40: Property 'selectedDash' does not exist on type 'NewDashboardDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/admin.dashboard.component.ngfactory.ts:323:39: Property 'pressSubmit' is private and only accessible within class 'NewDashboardDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/admin.dashboard.component.ngfactory.ts:323:55: Property 'selectedDash' does not exist on type 'NewDashboardDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/admin.dashboard.component.ngfactory.ts:358:39: Property 'pressSubmit' is private and only accessible within class 'NewDashboardDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/admin.dashboard.component.ngfactory.ts:358:55: Property 'selectedDash' does not exist on type 'NewDashboardDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/admin.dashboard.component.ngfactory.ts:389:32: Property 'selectedDash' does not exist on type 'NewDashboardDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.general.ngfactory.ts:628:43: Property 'pressAddFields' is private and only accessible within class 'EditDashboardGeneralComponent'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.general.ngfactory.ts:693:43: Property 'pressAddStatic' is private and only accessible within class 'EditDashboardGeneralComponent'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.general.ngfactory.ts:943:40: Property 'newFieldName' does not exist on type 'AddDashFieldDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.general.ngfactory.ts:947:39: Property 'pressSubmit' is private and only accessible within class 'AddDashFieldDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.general.ngfactory.ts:947:55: Property 'newFieldName' does not exist on type 'AddDashFieldDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.general.ngfactory.ts:1007:43: Property 'pressSubmit' is private and only accessible within class 'AddDashFieldDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.general.ngfactory.ts:1007:59: Property 'newFieldName' does not exist on type 'AddDashFieldDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.general.ngfactory.ts:1038:32: Property 'newFieldName' does not exist on type 'AddDashFieldDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.custom.ngfactory.ts:134:43: Property 'pressAdd' is private and only accessible within class 'EditDashboardCustomComponent'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.custom.ngfactory.ts:150:43: Property 'pressDelete' is private and only accessible within class 'EditDashboardCustomComponent'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.custom.ngfactory.ts:679:43: Property 'pressSubmit' is private and only accessible within class 'AddCustomDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.custom.ngfactory.ts:718:39: Property 'pressSubmit' is private and only accessible within class 'AddCustomDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.dynamic.ngfactory.ts:178:43: Property 'pressAdd' is private and only accessible within class 'EditDashboardDynamicComponent'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.dynamic.ngfactory.ts:194:43: Property 'pressDelete' is private and only accessible within class 'EditDashboardDynamicComponent'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.dynamic.ngfactory.ts:405:43: Property 'pressEditProperties' is private and only accessible within class 'EditDashboardDynamicComponent'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.dynamic.ngfactory.ts:611:43: Property 'pressSubmit' is private and only accessible within class 'AddDynamicDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.dynamic.ngfactory.ts:648:39: Property 'pressSubmit' is private and only accessible within class 'AddDynamicDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.dynamic.ngfactory.ts:845:40: Property 'newEndpoint' does not exist on type 'AddEditRestDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.dynamic.ngfactory.ts:954:40: Property 'newUsername' does not exist on type 'AddEditRestDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.dynamic.ngfactory.ts:1031:44: Property 'newPassword' does not exist on type 'AddEditRestDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.dynamic.ngfactory.ts:1152:64: Property 'newDashName' does not exist on type 'AddEditRestDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.dynamic.ngfactory.ts:1152:80: Property 'newDashType' does not exist on type 'AddEditRestDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.dynamic.ngfactory.ts:1177:64: Property 'newDashName' does not exist on type 'AddEditRestDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.dynamic.ngfactory.ts:1177:80: Property 'newDashType' does not exist on type 'AddEditRestDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.dynamic.ngfactory.ts:1207:36: Property 'newEndpoint' does not exist on type 'AddEditRestDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.dynamic.ngfactory.ts:1215:36: Property 'newUsername' does not exist on type 'AddEditRestDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.dynamic.ngfactory.ts:1219:36: Property 'newPassword' does not exist on type 'AddEditRestDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.message.ngfactory.ts:139:43: Property 'pressAdd' is private and only accessible within class 'EditDashboardMessageComponent'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.message.ngfactory.ts:155:43: Property 'pressDelete' is private and only accessible within class 'EditDashboardMessageComponent'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.message.ngfactory.ts:645:44: Property 'newMessageName' does not exist on type 'AddMessageDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.message.ngfactory.ts:649:43: Property 'pressSubmit' is private and only accessible within class 'AddMessageDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.message.ngfactory.ts:649:59: Property 'newMessageName' does not exist on type 'AddMessageDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.message.ngfactory.ts:684:39: Property 'pressSubmit' is private and only accessible within class 'AddMessageDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.message.ngfactory.ts:684:55: Property 'newMessageName' does not exist on type 'AddMessageDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.message.ngfactory.ts:715:32: Property 'newMessageName' does not exist on type 'AddMessageDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.security.ngfactory.ts:137:43: Property 'pressAddAdmin' is private and only accessible within class 'EditDashboardSecurityComponent'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.security.ngfactory.ts:153:43: Property 'pressDeleteAdmin' is private and only accessible within class 'EditDashboardSecurityComponent'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.security.ngfactory.ts:207:43: Property 'pressAddUser' is private and only accessible within class 'EditDashboardSecurityComponent'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.security.ngfactory.ts:223:43: Property 'pressDeleteUser' is private and only accessible within class 'EditDashboardSecurityComponent'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.security.ngfactory.ts:346:44: Property 'newAdmin' does not exist on type 'AddNotificationOneDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.security.ngfactory.ts:350:43: Property 'pressSubmit' is private and only accessible within class 'AddNotificationOneDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.security.ngfactory.ts:350:59: Property 'newAdmin' does not exist on type 'AddNotificationOneDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.security.ngfactory.ts:387:39: Property 'pressSubmit' is private and only accessible within class 'AddNotificationOneDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.security.ngfactory.ts:387:55: Property 'newAdmin' does not exist on type 'AddNotificationOneDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.security.ngfactory.ts:420:32: Property 'newAdmin' does not exist on type 'AddNotificationOneDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.security.ngfactory.ts:438:32: Property 'newAdmin' does not exist on type 'AddNotificationOneDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.security.ngfactory.ts:548:44: Property 'newUser' does not exist on type 'AddNotificationTwoDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.security.ngfactory.ts:552:43: Property 'pressSubmit' is private and only accessible within class 'AddNotificationTwoDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.security.ngfactory.ts:552:59: Property 'newUser' does not exist on type 'AddNotificationTwoDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.security.ngfactory.ts:589:39: Property 'pressSubmit' is private and only accessible within class 'AddNotificationTwoDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.security.ngfactory.ts:589:55: Property 'newUser' does not exist on type 'AddNotificationTwoDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.security.ngfactory.ts:622:32: Property 'newUser' does not exist on type 'AddNotificationTwoDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/edit.dashboard.security.ngfactory.ts:640:32: Property 'newUser' does not exist on type 'AddNotificationTwoDialog'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/save.dashboard.component.ngfactory.ts:37:39: Property 'pressSave' is private and only accessible within class 'SaveDashboardComponent'.
Error at C:/Users/DTurcich/Source/Repos/Interns/DashboardConsole/ASCI.DashboardConsole.Frontend/aot/src/app/save.dashboard.component.ngfactory.ts:57:43: Property 'pressCancel' is private and only accessible within class 'SaveDashboardComponent'.

AoT 的相关文件

tsconfig-aot.json

{
    "compilerOptions": {
        "target": "es5",
        "module": "es2015",
        "moduleResolution": "node",
        "sourceMap": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "lib": [ "es2015", "dom" ],
        "noImplicitAny": true,
        "suppressImplicitAnyIndexErrors": true,
        "typeRoots": [
            "../../node_modules/@types/"
        ]
    },

    "files": [
        "src/app/app.module.ts",
        "src/main.ts"
    ],

    "angularCompilerOptions": {
        "genDir": "aot",
        "skipMetadataEmit": true
    }
}

main.ts

import { enableProdMode } from '@angular/core'; 
import { platformBrowser } from '@angular/platform-browser';
import { AppModuleNgFactory } from '../aot/src/app/app.module.ngfactory';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

if (environment.production) {
    enableProdMode();
}

console.log('Running AOT compiled');
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);

我想从 JIT 迁移到 AOT 以获得更快的加载时间,这样当我实现 Tree Shaking 时它会更有效,但我不知道如何处理这些错误。请帮忙

4

2 回答 2

2
  • 对于所有Parameter '***' implicitly has an 'any' type.

在您的tsconfig-aot.json中,您要求noImplicitAny.

所以 Typescript 会告诉你什么时候声明一个变量而不指定类型。

  • 对于所有Property '***' is private and only accessible within class '***'.

这是因为您有尝试访问私有组件属性的模板 html。没有AOT编译,它不抱怨它,因为它是JS,但有AOT,它是Typescript,所以隐私检查。

  • 对于所有Property '***' does not exist on type '***'.

同样,您可以访问模板中的一些 Typescript 不存在的属性。也许你做了一些 JS 允许的魔法,但 Typescript 更严格。

于 2017-06-29T19:45:24.953 回答
1

运行应用程序ng run --prod将进行摇树并使用AOT编译运行应用程序。

如果您对更多细节感兴趣,我发现他们的wiki非常有用。

ng-cli 维基

哦,你当然也可以使用ng build --prod


关于错误,我建议您开始使用TS Lint,因为您违反了一些打字稿规则,主要是关于在声明它们的类之外使用私有属性和隐式类型定义(不声明类型,是的,甚至是任何类型)。
我强烈建议使用 JetBrains PHPStormWebStorm作为您的编辑器,它们提供了许多令人惊叹的工具,并且在其中启用 TS Lint 检查非常容易。
虽然它们不是免费的。

于 2017-06-29T19:43:54.463 回答