I am using ng2-smart-table for the tabular representation of data received over rest response. But one of the elements is complex. The intention is to display categoryName under category column.
category: {id: 1, categoryName: "category 1", active: true, createdBy: null, createdOn: null, …}
My "column" in settings looks like...
columns: {
id: {
title: 'ID',
type: 'number',
},
salesExecutive: {
title: 'Sales Executive',
type: 'string',
},
distributor: {
title: 'Distributor',
type: 'string',
},
product: {
title: 'Product',
type: 'string',
},
category: {
title: 'Category',
//***************** this must display "categoryName" from the complex "category" object
type: 'string',
},
discount: {
title: 'Discount',
type: 'string',
},
flavor: {
title: 'Flavor',
type: 'string',
},
promotion: {
title: 'Promotion',
type: 'string',
},
scheme: {
title: 'Scheme',
type: 'string',
},
},
Have observed some suggestions to use renderComponent. But dint see better examples.