我刚把angular更新到最新的9.0.0-next.4.我没有使用路由,但在更新之后,我突然看到了这个警告.如何删除此警告

src/war/angular/src/app/app-routing.module.ts中的警告是

package.json

  "dependencies": {
"@angular/animations": "^9.0.0-next.4",
"@angular/cdk": "^8.1.4",
"@angular/common": "^9.0.0-next.4",
"@angular/compiler": "^9.0.0-next.4",
"@angular/core": "^9.0.0-next.4",
"@angular/forms": "^9.0.0-next.4",
"@angular/material": "^8.1.4",
"@angular/platform-browser": "^9.0.0-next.4",
"@angular/platform-browser-dynamic": "^9.0.0-next.4",
"@angular/router": "^9.0.0-next.4",
"@ng-bootstrap/ng-bootstrap": "^5.1.0",
"bootstrap": "^4.3.1",
"hammerjs": "^2.0.8",
"moment": "^2.24.0",
"ng-image-slider": "^2.0.1",
"panzoom": "^8.1.2",
"rxjs": "~6.5.2",
"tslib": "^1.9.0",
"zone.js": "^0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.803.2",
    "@angular/cli": "^8.3.2",
    "@angular/compiler-cli": "^9.0.0-next.4",
    "@angular/language-service": "^9.0.0-next.4",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.0.0",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "^5.15.0",
    "typescript": "^3.5.3"
  }

tsconfig.json

    {
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "esnext",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ]
  }
}

推荐答案

事实证明,你需要从"包含"中删除这一行

Typescript相关问答推荐

Typescript联合类型-字段类型覆盖

如何在类型脚本中使用条件陈述循环

错误:note_modules/@types/note/globals.d.ts:72:13 -错误TS 2403:后续变量声明必须具有相同的类型

如何修复VueJS中的val类型不能赋给函数

如何根据参数的值缩小函数内的返回类型?

typescript抱怨值可以是未定义的,尽管类型没有定义

防止获取发出不需要的请求

SortKey类型不起作用,尽管它使用的单个类型工作正常<>'

为什么从数组中删除一个值会删除打字错误?

对深度对象键/路径进行适当的智能感知和类型判断,作为函数参数,而不会触发递归类型限制器

如何在另一个参数类型中获取一个参数字段的类型?

如何表示多层深度的泛型类型数组?

在分配给类型的只读变量中维护const的类型

剧作家元素发现,但继续显示为隐藏

返回嵌套props 的可变元组

跟踪深度路径时按条件提取嵌套类型

是否将Angular *ngFor和*ngIf迁移到新的v17语法?

在Google授权后由客户端接收令牌

在TypeScript中,如何通过一系列过滤器缩小类型?

从联合提取可调用密钥时,未知类型没有调用签名