我已經升級我的應用程序的最新角4(β-8)版本。但是我一直有以下錯誤:Angular4我應該用什麼定義可迭代的
@angular\core\src\change_detection\differs\iterable_differs.d.ts:14: TS2304 Cannot find name 'Iterable'
我沒有擡頭的更新日誌,發現:
的
Iterable<T>
的定義現在需要正確編譯角應用。在運行時不需要支持Iterable<T>
,但類型定義Iterable<T>
必須可用。
我應該在這裏使用的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"
}
什麼是您的打字稿版本? tsc --version – MikeOne
我的ts版本是2.1.4 – Scipion
好的,我在這裏抓住。您可以嘗試將「es2015.iterable.ts」添加到tsconfig.json中的「lib」定義中,但是,實際上並不需要這樣做。那裏有什麼庫? 「es6」?或更低? – MikeOne