加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

Angular4我应该使用Iterable的定义

发布时间:2020-12-17 07:55:39 所属栏目:安全 来源:网络整理
导读:我已将我的应用程序升级到最新的Angular 4(beta-8)版本.但是我一直有以下错误: @angularcoresrcchange_detectiondiffersiterable_differs.d.ts:14: TS2304 Cannot find name 'Iterable' 我确实查找了更改日志,发现: A definition of IterableT is now
我已将我的应用程序升级到最新的Angular 4(beta-8)版本.但是我一直有以下错误:

@angularcoresrcchange_detectiondiffersiterable_differs.d.ts:14: TS2304 Cannot find name 'Iterable'

我确实查找了更改日志,发现:

A definition of Iterable<T> is now required to correctly compile Angular applications. Support for Iterable<T> is not required at runtime but a type definition Iterable<T> must be available.

我应该在这里使用什么作为Iterable定义?

编辑:

tsconfig.json

"compilerOptions": {
    "target": "es5","module": "commonjs","moduleResolution": "node",/* for reading your ts source while debugging from a browser */
    "sourceMap": true,/* the following two settings are required for angular2 annotations to work*/
    "emitDecoratorMetadata": true,"experimentalDecorators":true,/* noImplicitAny when you want your typescript to be fully typed */
    "noImplicitAny":false,"suppressImplicitAnyIndexErrors":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"outDir": "./target/ts"
  }
在更改日志中声明的 migration后,您应该在tsconfig.json中添加es2015.iterable作为lib:
{
  ...,"compilerOptions" : {
     ...,"lib": ["es6","dom","es2015.iterable"]
   }
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读