One of the last version updates seems to have broken the ability to use templates in at least these components
- Dropdown List
- MultiSelect Dropdown
- Menu
The dropdown list does not show the right items, when using a template like in the offical samples (copy from demos https://ej2.syncfusion.com/angular/demos/#/material/drop-down-list/template). Error message in the browser console:
ERROR TypeError: Cannot read property 'template' of undefined
at eval (template.js:44)
at eval (dom.js:426)
at Object.s.renderContentTemplate (list-base.js:535)
at DropDownListComponent.l.templateListItem (list-box.js:2305)
at DropDownListComponent.l.renderItems (list-box.js:2305)
at DropDownListComponent.eval (list-box.js:2305)
at DropDownListComponent.e.trigger (template.js:44)
at DropDownListComponent.eval (list-box.js:2305)
at DropDownListComponent.e.trigger (template.js:44)
at DropDownListComponent.l.setListData (list-box.js:2305)
Using the source code from the sample page:
<ejs-dropdownlist id='employees' [dataSource]='data' [fields]='fields' [popupHeight]='height' [placeholder]='watermark'>
<ng-template #headerTemplate>
<div class="head"> <span class="photo">Photo</span> <span style="margin-left:17px;">Employee Info</span></div>
</ng-template>
<ng-template #itemTemplate let-data>
<div><img class="empImage" src="./assets/auto-complete/Employees/{{data.Eimg}}.png" alt="employee" />
[...]
</div>
</ng-template>
<ng-template #valueTemplate let-data>
[...]
</ng-template>
</ejs-dropdownlist>
The issue can be reproduced from the demos, when launching the "Stackblitz" links like from these pages
- https://ej2.syncfusion.com/angular/demos/#/material/drop-down-list/template
- https://ej2.syncfusion.com/angular/demos/#/material/multi-select/template
- https://ej2.syncfusion.com/angular/demos/#/material/combo-box/template
I do see the very same error messages in my local development environment. Any hints what needs to be done to make this work?