royB royB - 8 months ago 63
HTML Question

ngFor create 2 rows

Using Angular 2 ngFor I'm creating a table.

My problem is that

my data array
such that each element should create 2 consecutive rows in the table (Using different fields, The second row is collapsible with more data)

<tr *ngFor="let element of data; let i = index">

Problem is that
doesn't allow any attribute beside

I'm looking for something like

<template *ngFor="let element of data; let i = index">
<tr>...</tr> //row 1
<tr>...</tr> //row 2


That exists with slightly different syntax:

<template ngFor let-element [ngForOf]="data" let-i="index">
   <tr>...</tr> //row 1
   <tr>...</tr> //row 2