I populated my selection list with a list of items. How can I specify which item should be selected in the list after it has been loaded?
Here is the HTML code snippet:
<div class="col-md">
<div class="form-group">
<label>Sub Issue Listbox</label>
<mat-selection-list
#IssueList
style="max-height: 250px; overflow: auto"
formControlName="issueId">
<mat-list-option
*ngFor="let item of subIssueList"
[value]="item.issueId">
{{ item.issueDesc }}
</mat-list-option>
</mat-selection-list>
<p>
Options Selected:
{{ IssueList.selectedOptions.selected.length }}
</p>
<button
(click)="updateOqcReject()"
mat-raised-button
color="accent">
Update Issue
</button>
</div>
</div>
This is the array for the loaded list.
https://i.sstatic.net/HTtYA.png
And this is the array for the selected list. https://i.sstatic.net/Ct0wb.png
If anyone could provide guidance on how to set the selected value in the list, that would be greatly appreciated.