【发布时间】:2021-04-15 16:23:27
【问题描述】:
我刚刚将 Angular 从 6 升级到 11,并将 typescript 升级到 4.1.5。 我在更改数组中任何对象的属性时遇到问题。结果报错
core.js:6150 ERROR TypeError: Cannot assign to read only property 'active' of object '[object Object]'
我要更改的对象是:
export interface Agreement {
active: boolean;
...
}
此外,当我尝试向任何列表添加内容时,我会收到此错误:
ERROR TypeError: Cannot add property 4, object is not extensible
at Array.push (<anonymous>)
我是否缺少任何全局配置属性?
【问题讨论】: