|
<ejs-listbox [dataSource]="dataSource">
<ng-template #itemTemplate let-data>
<span> {{data.text|json}} <ejs-checkbox></ejs-checkbox></span>
</ng-template>
</ejs-listbox>
|
|
export class AppComponent {
// dataSource definition
public dataSource;
public data: { [key: string]: Object }[] = [
{ text: 'Hennessey Venom', id: 'list-01' },
{ text: 'Bugatti Chiron', id: 'list-02' },
{ text: 'Bugatti Veyron Super Sport', id: 'list-03' },
{ text: 'SSC Ultimate Aero', id: 'list-04' },
{ text: 'Koenigsegg CCR', id: 'list-05' },
{ text: 'McLaren F1', id: 'list-06' },
{ text: 'Aston Martin One- 77', id: 'list-07' },
{ text: 'Jaguar XJ220', id: 'list-08' },
{ text: 'McLaren P1', id: 'list-09' },
{ text: 'Ferrari LaFerrari', id: 'list-10' }
];
ngAfterViewInit() {
setTimeout(() => {
this.dataSource = this.data;
});
}
}
|
|
<ng-template #itemTemplate let-data>
<span> {{data.text|json}} <ejs-checkbox></ejs-checkbox></span>
</ng-template>
|