Cannot assign to read only property 'name' of object '[object Object]'

后端 未结 6 1514
攒了一身酷
攒了一身酷 2021-02-04 03:19

The following code will throw an error only for the name property. It could be fixed by specifying name property as writable in Object.create

6条回答
  •  攒了一身酷
    2021-02-04 04:04

    If you get this error in Angular+TypeScript:

    WRONG / INVALID:

    @Output whatever_var = new EventEmitter();

    GOOD / CORRECT:

    @Output() whatever_var = new EventEmitter();

提交回复
热议问题