In this mat-option i'm tryng to show data from an observable i subscribed to.
<mat-option *ngFor="let option of (filteredCustomer | async)?.Items"
[value]="option" (onSelectionChange)="searchDest($event)">
{{option.Cityname}}
</mat-option>
The name of the observable is filteredCustomer.
Now in the mat option i'm tryng to show city names. Thats the result.
Los Angeles
Boston
Detroit
Los Angeles
Washington
Los Angeles
As you can see i have duplicates.
It's possible to remove duplicates (like a distinct in sql)?
My observable come from this ts file:
public filterCity() {
var parameters = new CitySearchParameters(100, 0);
parameters.City = this.city;
this.filteredCustomer = this.customerService.get(parameters);
if (typeof (this.city) == "object") {
var curCity: any = this.city;
this.city = curCity.City;
}
}
Thanks