我如何使用打字稿获取角度上的空对象的键?
我的对象
export class ProdutoAgil{
constructor() {}
public IdEmpresa: number;
public IdGrupo: number;
public Nome: string;
public Codigo: string;
public ValorVenda: number;
public Ncm: string;
public IdImpostoIcms: number;
public CustoMedio: number;
}
现在我需要捕获键,以便用它来做一个数组,像这样:
myArray: any[] = ['IdEmpresa','IdGrupo','Nome','Codigo','ValorVenda','Ncm','IdImpostoIcms','CustoMedio']
我尝试执行Object.keys(new ProdutoAgil()),但返回值为空