我最近将我的项目从 angular6 升级到了 angular7。Visual Studio 代码开始在推送、长度等方面显示警告。例如, [ts] 属性“推送”在类型“{}”上不存在。
我已经初始化了数组
this.errorMessages = [];
this.errorMessages.push(errorMessage);
同样,它的长度也显示
if(this.model.str.length > 0)
[ts] 类型“字符串”上不存在属性“长度”。
但是当它运行时
服务
它运行正常。有什么建议么