- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我在 Stackoverflow 和网络上进行了搜索,我找到了这个帖子 https://github.com/Microsoft/TypeScript/issues/14813但它不能解决我的问题。我在使用 ng serve --watch
编译我的代码时遇到了这个错误。
Error TS2339: Property 'entries' does not exist on type 'FormData'.
这部分 fd.entries()
触发了错误...知道这里发生了什么吗?
onFileSelected(event) {
const fd = new FormData;
for (const file of event.target.files) {
fd.append('thumbnail', file, file.name);
const entries = fd.entries();
// some other methods are called here e. g. upload the images
for (const pair of entries) {
fd.delete(pair[0]);
}
}
}
我看到那里 ( https://github.com/Microsoft/TypeScript/blob/master/src/lib/dom.iterable.d.ts ) 是 entries
的一些接口(interface),但不知何故这对我不起作用。
编辑
我的 tsconfig.json
看起来像这样
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
}
}
最佳答案
您需要在 tsconfig.json
中的 lib
列表中添加“dom.iterable”,例如:
{
"compilerOptions": {
"baseUrl": ".",
"outDir": "build/dist",
"module": "esnext",
"target": "es6",
"lib": [
"es2019",
"dom",
"dom.iterable" // <- there you are
],
// ...
}
关于angular - 错误 TS2339 : Property 'entries' does not exist on type 'FormData' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50677868/
Eclipse 提示此代码“类型参数 Entry 隐藏了类型 Map.Entry”: import java.util.Map.Entry; public class Test { stat
这两个for语句是等价的。 import java.util.Map; import java.util.Map.Entry; for (Map.Entry entry: map.entrySet()
我想在 python 字典中添加一个键/值,它依赖于现有的键/值。示例 x = {} x["length"] = 12 x["volume"] =x["lenght"] * 10 行得通;但是有没有可
我使用 NuGet 将我的 EntityModel 升级到版本 4.3。 现在我想更改我的 EntityObject.State,但找不到 .Entry() 方法。 当前状态是已删除。 这就是我想要做
我是 Java 新手,正在使用 HashMap 在 Mac 上编写 Java。 但是我遇到了一个问题,找不到答案 import java.util.Map; import java.util.Hash
我正在切换一个小应用程序(Win 7/64 上的 Python 2.7.3/32)来使用 ttk,但我在使 ttk.Entry 按照 tk.Entry 的方式工作时遇到问题;当我设置其内容时,ttk.
为什么我需要在 i.next(); 前面加上 (Map.Entry) ?为什么我不能只有 Map.Entry m = i.next();? 对不起。它是一个 HashMap。 最佳答案 因为它显然不是
我的 xPage SSJS 失败: viewEntry = view.getNext(viewEntry); 有错误 Notes error: Entry not found in index 我确实
我正在使用 DataTable在我的申请中。 我想隐藏左下角的细节,我该怎么做? “显示 1,657 个条目中的 1 到 10 个(从 9,044 个条目中筛选出来)” 这是我的设置: $('#inv
我有两列,一个时间戳和一个已选择卡片的数字。 card added 1 2016-09-23 13:48:48 3 2016-09-23 13:48:48 1
我正在使用 Entity Framework 4.1,并且我有我的 DbContext Override SaveChanges 来审核属性更改。从“GetEntryValueInString”返回空
我正在使用 Tkinter 在 Python 3 上编写 GUI,但每次使用 Entry() 时,我都会收到名称错误。 我尝试了一个更简单的代码版本,(写在下面),但它仍然导致了 NameError:
我刚刚创建了一个插入方法来对数组进行排序,这是我在该方法中完成的代码; public static void insertionSort (Entry[] array2){ for (int
使用这个例子1对于 n:n 关系: (来源:tekstenuitleg.net) 设置主要或主要多对多字段的最佳方法是什么?示例:假设我想将经销商“Devrolijke drinker”(ID AB9
是否可以使用 Entry 通过 AsRef 获取值的 API , 但用 Into 插入它? 这是工作示例: use std::collections::hash_map::{Entry, HashMa
是否可以使用 Entry 通过 AsRef 获取值的 API , 但用 Into 插入它? 这是工作示例: use std::collections::hash_map::{Entry, HashMa
是否可以使用 Entry 通过 AsRef 获取值的 API , 但用 Into 插入它? 这是工作示例: use std::collections::hash_map::{Entry, HashMa
表定义: CREATE TABLE PositionalDataNGS ( Date DATE, Time TIME(3) , X FLOAT(5), Y FLOAT(5), D FLOAT(5) ,
我的平台: PHP 和 MySQL 我这里有什么: 我有 4 个表,分别是“books”、“book_type”、“book_categories”、“all_categories”。 我想做什么:
I am using MySQL 5.1.56, MyISAM. My table looks like this:我使用的是MySQL 5.1.56,MyISAM。我的桌子是这样的: CR
我是一名优秀的程序员,十分优秀!