【发布时间】:2018-11-25 08:56:15
【问题描述】:
我正在使用 typescript 3.8.3 和 loadash 进行 angular 5 项目。我使用 Visual Studio Code 作为我的编辑器。我最近将我的 Visual Studio Code 更新到了 1.24.0 版
更新后,我在 Visual Studio 代码中遇到了一些代码语法错误。这些错误不会导致任何编译器故障,而是在我的代码中显示为红色。我得到的一个恼人的问题是使用负载的以下代码:
let id: string = '122354';
let queue: any[] = records;
_.find(queue, {value: id}) // loads iteration function
我的错误信息
Argument of type '{ value: string; }' is not assignable to parameter of type 'ObjectIterateeCustom<any[], boolean>'.
Type '{ value: string; }' is not assignable to type 'ObjectIterator<any[], boolean>'.
Type '{ value: string; }' provides no match for the signature '(value: any, key: string, collection: any[]): boolean'.
不幸的是,我无法使用值类型定义队列。删除此语法错误的选项有哪些?提前致谢。
【问题讨论】:
标签: angular typescript visual-studio-code lodash