0
不工作我有一個數據列表使用primeng但在運行應用程序時,我得到這個錯誤:PrimeNg數據列表角4
不能綁定到「價值」,因爲它不是一個'對DataList控件'
已知財產的HTML文件:
<p-dataList [value]="cars">
<ng-template let-car pTemplate="item">
Car content
</ng-template>
</p-dataList>
我的組件文件是:
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app';
}
export class DataListDemo implements OnInit {
cars: Car[];
constructor(private carService: CarService) { }
ngOnInit() {
this.carService.getCarsLarge().then(cars => this.cars = cars);
}
}