【发布时间】:2018-03-19 06:33:18
【问题描述】:
嘿,如果我在我的代码库中更新以下代码,我会收到以下错误,你能告诉我如何修复它吗?在下面提供我的代码和错误
let spaceService;
beforeEach(inject(function(_spaceService_, ''){
spaceService = _spaceService_
));
Argument of type '(_spaceService_: any) => any' is not assignable to pramter of type 'any[]'.
类型“(spaceService:any) => any”中缺少属性“push”。
【问题讨论】:
-
错误句的其余部分是什么?
-
@ZivWeissman 感谢您的回复...更新了完整的错误
-
所以基本上你有你需要的答案 - spaceService 是一个数组,所以你可以使用 spaceService.push(/_spaceService_/) 或 spaceService[0] = /_spaceService_/ - 为什么 spaceService 是一个数组?
-
@ZivWeissman 你能在我的代码中更新一下吗,太令人困惑了:(
-
我已经添加它作为答案我希望它更清楚,你可能需要弄清楚你是否需要数组。
标签: javascript jquery html angularjs typescript