I'm having trouble using the mat-select-filter to filter data:
<mat-form-field *ngIf="fundComplexesList">
<mat-select placeholder="Using array of objects">
<mat-select-filter [placeholder]="'Filter'" [displayMember]="'fundComplexName'" [array]="fundComplexesList" (filteredReturn)="filteredList5 =$event"></mat-select-filter>
<mat-option *ngFor="let item of filteredList5" [value]="item">
{{item.fundComplexName}}
</mat-option>
</mat-select>
</mat-form-field>
The value for fundComplexesList is fetched from an api call
`ngOnInit(): void {
this.agreementService.getFundComplexes(false).subscribe(data => {
this.fundComplexesList = data;
},
error => {
console.log('Error while binding FundComplex dropdown.');
});
`
Here's my filter method:
`public filteredList5 = this.fundComplexesList.slice();`
The issue arises when I try to use this.fundComplexesList value in public filteredList5 = this.fundComplexesList.slice(); function. Can anyone suggest a solution on how to ensure that the value in fundComplexesList is obtained before calling filteredList5 = this.fundComplexesList.slice();