当尝试使用window.FormData
我得到以下错误:打字稿不知道FORMDATA是什么
The name 'FormData' does not exist in the current scope
同样发生的FileReader
当尝试使用window.FormData
我得到以下错误:打字稿不知道FORMDATA是什么
The name 'FormData' does not exist in the current scope
同样发生的FileReader
可以检查功能存在使用:
if (window.FormData) {
alert('Yes');
}
这依赖于错误的检查 - 如果你想明确,使用。
if (typeof FormData !== 'undefined') {
alert('Yes');
}
它应该,因为有一个[问题](http://typescript.codeplex.com/workitem/720)关于它,已经修复。什么版本的TypeScript被使用? – raina77ow
版本0.8.3.1 – localhost
奇怪。好的,如果你使用没有'window'前缀的'FormData'? – raina77ow