export class DataTableFilterDemo implements OnInit {
cars: Car[];
constructor(private carService: CarService) {}
ngOnInit() {
this.carService.getCarsMedium().then(cars => this.cars = cars);
}
}
<p-dataTable [value]="cars" [rows]="10" [paginator]="true">
<header>List of Cars</header>
<p-column field="vin" header="Vin (startsWith)" [filter]="true"></p-column>
<p-column field="year" header="Year (contains)" [filter]="true" filterMatchMode="contains"></p-column>
<p-column field="brand" header="Brand (startsWith)" [filter]="true"></p-column>
<p-column field="color" header="Color (endsWith)" [filter]="true" filterMatchMode="endsWith"></p-column>
</p-dataTable>