Hello i want to filter the array that it is returned. I have this on.html file
<ion-col col-3>
<a class="circle" (click)="filter('T')">
<ion-icon name="document" [ngClass]="mediaType == 'T' ? 'active' : ''"></ion-icon>
</a>
</ion-col>
and this is the values and functions i have on .ts file
export class AllMediaPage {
allMedia:any =[];
mediaType:string = '';
constructor(
allMediaSet(){
this.userData.allMedias(this.mediaType)
.map(res => res.json())
.subscribe(data => {
if (data.success) {
this.allMedia = data.mediaFeed;
}
});
}
filter(mediaType: any) {
this.mediaType = mediaType;
}