Когда вы посмотрите на дерево DOM, вы обнаружите, что
<tr><app-customer-details>...</app-customer-details</td>
Это не приведет к визуализации компонента в таблице как к, а будет заполнять весь компонент HTML шаблон внутри одного столбца.
Добавив селектор атрибута к компоненту, т.е. селектор: 'app-customer-details, [app-customer-details]', вы можете добавить селектор непосредственно к элементу, как и тогда, и теперь элементы внутри Шаблон компонента HTML будет правильно отображаться внутри таблицы.
Посмотрите на эту ссылку ;
Правильный код следующий: Customer-list.component. html
<div class="container">
<div class="title">
<h3>Customer Table</h3>
</div>
<div class="row">
<div class="col-md-12">
</div>
<div class="col-lg-8 col-md-10 ml-auto mr-auto">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<!-- <th class="text-center">#</th> -->
<th>Name</th>
<th>Age</th>
<th>Active</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let customer of customers" [customerDetails]="customer">
</tr>
<div style="margin-top:20px;">
<button type="button" class="button btn-danger" (click)='deleteCustomers()'>Delete All</button>
</div>
</tbody>
</table>
</div>
</div>
</div>
</div>
Customer-details.component. html
<td>
{{customerDetails.name}}
</td>
<td>
{{customerDetails.age}}
</td>
<td>
{{customerDetails.active}}
</td>
Customer-details.component.ts
import { Component, OnInit, Input } from '@angular/core';
@Component({
selector: 'customerDetails, [customerDetails]',
templateUrl: './customer-details.component.html',
styleUrls: ['./customer-details.component.css']
})
export class CustomerDetailsComponent implements OnInit {
@Input() customerDetails: object = {};
constructor() { }
ngOnInit() {
}
}