export class DataTableEditableDemo implements OnInit {
cars: Car[];
cols: Column[];
constructor(private carService: CarService) { }
ngOnInit() {
this.carService.getCarsSmall().then(cars => this.cars = cars);
this.cols = [
{field: 'vin', header: 'Vin', editable: true},
{field: 'brand', header: 'Brand', editable: true},
{field: 'year', header: 'Year', editable: true},
{field: 'color', header: 'Color', editable: true}
];
}
}
<p-dataTable [value]="cars" [columns]="cols" editable="true"></p-dataTable>