【发布时间】:2023-01-02 18:35:08
【问题描述】:
}
Error(resp){
console.debug(resp.json());
}
Success(resp){
this.CustomerModels = resp.json();
}
我为错误响应和成功响应创建了一种方法,但是我收到“参数‘resp’隐式具有‘任何’类型”的错误。
【问题讨论】:
-
那是因为你没有指定类型。 resp 是什么类型?将此
(resp: YourType)或直接添加到 http 调用:this.http.get<YourType>(...)(或您使用的任何 http 函数) -
你能重新输入这段代码吗?因为我明白了
标签: jquery angular typescript