如何获取Angular中数据模型的class名称?

How to get the class name of the data model in Angular?

在 Angular 中使用此数据模型代码:

export class Car {
  brand: string;
  year: number;
  nameOfModel() => {
    // I need return here the name of class as a string: 'Car'
  }
}

我能以某种方式取回 class 的名称作为字符串吗?

这对我有用:

export class Car {
    brand: string;
    year: number;
    nameOfModel: string = () => {
        return Car.name
    }
}