Open
Description
zzz = [
{ id: 1, v: 'santi' },
{ id: 2, v: 'olga' },
{ id: 3, v: 'pedro' },
{ id: 4, v: 'pepe' },
];
aaa = new FormControl({ id: 1, v: 'santi' });
handleDisplayFn2 = (value: T | string): string => {
if (typeof value === 'string') {
return value;
}
return get(value, 'v', ''); // example: {id: 1, v: "santi" } --> "santi"
};
input [formControl]="aaa" #autoInput2 [nbAutocomplete]="auto2" [focusInputOnValueChange]="false" />
<nb-autocomplete #auto2 (selectedChange)="handleSelectionChange($event)" [handleDisplayFn]="handleDisplayFn2">
@for (z of zzz; track z.v) {
<nb-option [value]="z">
{{ z | get: 'v' }}
</nb-option>
}
</nb-autocomplete>
When I started input text should be "santi" but [Object Object] is write in input
Metadata
Metadata
Assignees
Labels
No labels