0

I am listing a list of values in mat-select. Here is my code;

<div class="row">
                                    <div class="col-md-1">
                                        <mat-form-field class="mat-form-field-fluid">
                                            <mat-select placeholder="select" formControlName="myList" id="myList">
                                                <ngx-mat-select-search [formControl]="frmControl" #fltr >
                                                </ngx-mat-select-search>
                                                <mat-option id="myListValue" [value]="item.code"  *ngFor="let item of ListOfSelect | filterByProperty: ['descp',filter.value];">{{ item.description}}
                                                </mat-option>
                                            </mat-select>
                                        </mat-form-field> 
                                    </div>

I want to add a new value to this list and also make it as selected value.

How can I do that?

Samuel
  • 3
  • 3
  • How did you try to add the new value? Did you try to extend `ListOfSelect`? – Tonnio Nov 22 '21 at 19:21
  • Does this answer your question? [Angular Material: mat-select not selecting default](https://stackoverflow.com/questions/47333171/angular-material-mat-select-not-selecting-default) – Roy Nov 22 '21 at 19:22
  • @Tonnio yes, I pushed new value to ListOfSelect, and I want to set it as selected on – Samuel Nov 22 '21 at 19:26
  • @Roy I don't think so.. I tried however it didn't work in my situation – Samuel Nov 22 '21 at 19:51

0 Answers0