I have an ngx-form-settings and a dropdown object in a column. This dropdown should be populated by a query (through a service call).
This is the settings:
site: {
title: 'SITE',
type: 'html',
editor: {
type: 'list',
config: {
list: [],
},
}
},
if I do this, it works (of curse this is not what I need as the setList must be into the getData.subscribe):
ngOnInit() {
this.service.getData().subscribe((data: any) => {
});
this.setList();
}
if I do this, it doesn't work:
ngOnInit() {
this.service.getData().subscribe((data: any) => {
this.setList();
});
}
where set list is just this (for now):
setList() {
this.settings.columns.site.editor.config.list = [{ value: 'Option 1', title: 'Option 1' },
{ value: 'Option 2', title: 'Option 2' },
{ value: 'Option 3', title: 'Option 3' },
{ value: 'Option 4', title: 'Option 4' },
{ value: 'Option 5', title: 'Option 5' },
{ value: 'Option 6', title: 'Option 6' },
];
}
what am I missing?