How can I remove the duplicates from this ngFor? I'd like to do that on the HTML, not on the component?
<mat-option *ngFor="let primer of dataService.data" [value]="primer.type" id="primer">{{primer.type}}</mat-option>
How can I remove the duplicates from this ngFor? I'd like to do that on the HTML, not on the component?
<mat-option *ngFor="let primer of dataService.data" [value]="primer.type" id="primer">{{primer.type}}</mat-option>
Why dont you want to implement the fitering logic in the component? I think it would be the cleanest way to go. For an examle look here: Angular Pipe to Hide Duplicates from Array The solutions is not quite perfect, but it sould give you an idea.
But if you must do it in template, you could create a pipe that filters and just apply it to the data you are iterating over.