如果我有一个具有计算属性的类,如何将其绑定到ag-grid?
export class SomeModel {
firstName: string;
lastName: string,
get fullName: string {
return this.firstname + ' ' + this.lastName;
}
}
我知道我可以使用valueGetter,但是如何使计算属性起作用?
this.columnDefs = [
{
headerName: 'FullNameWorks',
valueGetter: 'return data.firstName + '' + data.lastName;'
},
{
headerName: 'FullNameDoesNotWork',
field: 'fullName'
}
];