Angular: 7.2.1 ES6 class ReferenceError : Cannot access 'X' before initialization

后端 未结 5 2095
别那么骄傲
别那么骄傲 2020-12-10 10:44

I\'m having the following TypeScript class

export class Vehicule extends TrackableEntity {
  vehiculeId: number;
  constructor() {
    super();
    return s         


        
5条回答
  •  有刺的猬
    2020-12-10 11:19

    that make sense, you are passing the local object (Vehicle) to the parent class within constructor return super.proxify(this);.

    Keep in mind the local Vehicle instance has not been instantiated yet (constructor block is not finished yet), so you cannot use this object in the mean time, you need to wait the constructor to done it's job.

提交回复
热议问题