I have created one pipe to sort an object array based on the value of the object property.keep all Objects with property show==0
and show==1
are removed,there is no any error and can be seen in the console.
pipe.ts
@Pipe({
name: 'menufilter'
})
@Injectable()
export class MyMenuFilterPipe implements PipeTransform {
transform(items: any[], args: any[]): any {
if (items) {
return items.filter(item => item.show == '0',console.log(item));
}
}
app.html
<tr *ngFor="let menu of specificmenus|menufilter" >
<td >{{menu.name}}</td>
</tr>