https://github.com/akveo/ng2-smart-table In settings object,we define structure to show fields like name, title etc.I want to assign object to columns directly. Object contains fields
only.settings = {
editable: false,
mode: 'inline',
add: {
confirmCreate: true
},
edit: {
confirmSave: true,
},
actions: {
delete: false
},
columns: {
food: {
title: 'Food',
filter: false,
},
quantity: {
title: 'Quantity',
filter: false,
},
unit: {
title: 'Unit',
filter: false,
editor: {
type: 'list',
config: {
list: [
{ value: 'gm', title: 'gm' },
{ value: 'slice', title: 'slice' },
{ value: 'cup', title: 'cup' },
{ value: 'glass', title: 'glass' },
{ value: 'pcs', title: 'pcs' },
{ value: 'ml', title: 'ml' },
{ value: 'bowl', title: 'bowl' },
{ value: 'tbspn', title: 'tbspn' }
]
}
}
},
I have to create
array =>units[]= { value: 'bowl', title: 'bowl' },{ value: 'tbspn', title: 'tbspn' }
Want to Assign =>
list: this.units
but its not working. It's in case when I get array by web service call.