I have a mat-select dropdown for filtering data on the UI. I emit the data from the child component to the parent component with the getTeam function
Mat-Select
<mat-form-field>
<mat-label>Select Team</mat-label>
<mat-select (selectionChange)="getTeam($event)">
<mat-option *ngFor="let team of teams" [value]="team.name">
{{team.name}}
</mat-option>
</mat-select>
</mat-form-field>
<span class="material-icons" (click)="reset()">delete_sweep</span>
Filter logic (.ts) The getTeamQuery receives the emitted value and filters the UI data.
videos: Video[] = videos;
filteredVideos: Video[] = videos;
getTeamQuery(queryEmitted: string) {
this.videos = this.filteredVideos.filter(video => {
return video.team === queryEmitted;
});
}
**Clearing the filter selection**
reset() {
this.videos = videos;
}
How can I reset the selection of the mat-select and return to the initial state, by clicking the material icon? Initial state, meaning the state where the mat-select value is the placeholder.