私は配列があります。<thead/>で反復処理中にテンプレートを選択する方法は?
let headers = [
{ title: 'First Name', style: 'bold' },
{ title: 'Last Name', style: 'bold' },
{ title: 'Book', style: 'bold', titleSecond: 'All/Remainder', style2:'not bold' },
{ title: 'City', style: 'not bold', titleSecond: 'Street', style2: 'not bold' }
];
を、私は、単純なHTMLテーブルを反復処理しています:
<table>
<thead>
<tr>
<th *ngFor="let header headers">
{{ header.title }}
</th>
</tr>
</thead>
</table>
は次のようになりますテーブルヘッダを作成することが可能です:
テーブルヘッダーのテンプレートをいくつか作成できますか?このheaders
オブジェクトを変更したいので、オブジェクトを変更することができます。
問題は何ですか?なぜあなたの4番目のオブジェクトは重複したプロパティ 'style'を持っていますか? – yurzui
@yurzuiおっと、申し訳ありませんが、私はオブジェクトを編集しました。 – StepUp