У меня есть раскрывающееся меню с набором значений в моем угловом приложении.
На экране просмотра в раскрывающемся списке не отображается выбранное значение (значение, сохраненное в дБ), вместо этого отображается «Выбор».
HTML:
<p-dropdown [options]="reasons" [(ngModel)]="selectedReason" (onChange)="getCompleteReason($event)" styleClass="ui-column-filter" filter="true"> </p-dropdown>
Component.ts
this.reasons = [];
this.reasons.push({label: 'Select', value: null});
this.reasons.push({label: 'Reason 1', value: 'Reason 1'});
this.reasons.push({label: 'Reason 2', value: 'Reason 2'});
this.reasons.push({label: 'Reason 3', value: 'Reason 3'});
this.reasons.push({label: 'Other', value: 'Other'});
this.selectedReason = 'Reason 2' (eg value stored in the db)
![enter image description here](https://i.stack.imgur.com/BPiGl.png)