【问题标题】:Angular 2 | cannot assign to variable because it is a constant or a read-only property角 2 |无法分配给变量,因为它是常量或只读属性 【发布时间】:2018-06-29 07:56:44 【问题描述】: 当我在构造函数中使用变量名时,它会显示消息 [ts] 无法分配给“名称”,因为它是常量或只读的 财产!! 【问题讨论】: 标签: angular 【解决方案1】: 终于有答案了!!我们应该使用 this.name。 ngOnInit() { this.name='Amritha'; } 【讨论】: