Это должно быть просто c, но я почему-то борюсь
table.component.ts
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-table',
templateUrl: './table.component.html',
styleUrls: ['./table.component.css']
})
export class TableComponent implements OnInit {
tableTitle = 'Table';
tableHeaders = [
'Project',
'Budget',
'Status',
'Users',
'Completion',
'Actions'
];
constructor() { }
ngOnInit(): void {
}
}
table.component. html
<table class="table align-items-center table-flush">
<thead class="thead-light">
<tr *ngFor="let header of tableHeaders">
<th scope="col">{{header}}</th>
</tr>
</thead>
....
ничего не показывает .... Я попытался добавить заголовки с некоторыми значениями c, например <th scope="col"> Hello world </th>
, и работает нормально .... также попытался напечатать что-то вроде
<table class="table align-items-center table-flush">
<thead class="thead-light">
<tr>
<th scope="col">{{tableHeaders[0]}}</th>
<th scope="col">{{tableHeaders[1]}}</th>
<th scope="col">{{tableHeaders[2]}}</th>
</tr>
</thead>
и снова работает нормально, так что переменная присутствует в html ..... но при попытке вставить его через * ng для ничего не показывает ... что я делаю не так?