Как обернуть панель расходов в шаблон в моем случае?
ERROR TypeError: Cannot read property 'details' of undefined
Версия Angular 4 и версия Angular-Material 2 (я знаю, что версия 8 уже выпущена, но у меня нет возможности перейти на более новую версию).
<md-tab-group [selectedIndex]="index" (selectedIndexChange)="index = $event">
<md-tab label="First">
<md-list>
<ng-container *ngTemplateOutlet="tabContent; context: index">
<md-accordion>
<div *ngFor="let item of items">
<ng-container *ngTemplateOutlet="itemList; context: item"></ng-container>
</div>
</md-accordion>
</md-list>
</md-tab>
<md-tab label="Second">...</md-tab>
</md-tab-group>
<ng-template #tabContent let-index>Header</ng-template>
<ng-template #itemList let-item>
<md-expansion-panel>
<md-expansion-panel-header></md-expansion-panel-header>
<div class="item-detail">
<div *ngFor="let detail of item.details">...</div>
</div>
</md-expansion-panel>
</ng-template>