In my angular application I am using ng2-smart-table. In one column I would like to use a list of objects that have an id and a description.
I managed to do it this way:
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ],
template: `
<ng2-smart-table [settings]="settings"></ng2-smart-table>
`
})
export class AppComponent {
name = 'Angular';
test = [
{title: '1', value: 'test1'},
{title: '2', value: 'test2'},
{title: '3', value: 'test3'}
];
settings = {
columns: {
campagna: {
title: 'campaign',
filter: false,
width: '250px',
type: 'html',
editor: {
type: 'list',
config: {
list: this.test,
},
}
}
}
};
}
The problem is that the title representing the id of the object is displayed in the combobox. when I add the selected object, the description is correctly displayed.
I would like the description to appear in the combobox.
There is a way to do it?
This is stackblitz: https://stackblitz.com/edit/angular-btgun6
Thank You