2017-10-20 2 views

Antwort

0

Sie ein Rohr schaffen kann, wie folgt,

@Pipe({name: 'filterByPropertyId'}) 
export class FilterByPropertyId implements PipeTransform { 

    transform(yourList: yourObject[], property_id: string): any[] { 
     if (yourList) { 
      return yourList.filter((yourList: yourObject) => list.property_id === property_id); 
     } 
    } 
} 

und in der Komponentenebene

<div *ngFor="let r of yourList| FilterByPropertyId:propertyId"> 

    </div> 
Verwandte Themen