The first screenshot is a console log of the array(messageSplit) I want to display. The second screenshot is how I want the data to look when it's displayed - basically each item of the sub arrays in a td table element.
I have tried the below code, but this gives the dreaded 'Expression has changed after it was checked' error.
<div *ngFor="let item of messageSplit[increment()];
<td>{{item}}</td>
</div>
increment() {
if (this.counter < this.messages.length) {
return this.counter++;
}
Please can someone explain the right way to go about doing this?
The below code will output as shown in screenshot 3 and is not the desired output as all of the sub arrays are inside a single td element
<div *ngFor="let message of messageSplit;">
<td *ngFor="let item of message">{{item}}</td>
</div>
Below is the full code for the particular tr
<tr *ngFor="let message of messages" [routerLink]="['/members',
messageContainer == 'Outbox' ? message.recipientId :
message.senderId]" [queryParams]="{tab:'3'}">
<div *ngFor="let message of messageSplit">
<td *ngFor="let item of message"> {{item}}></td>
</div>
<td>
<div *ngIf="messageContainer != 'Outbox'">
<!-- <img [src]="message.senderPhotoUrl" class="img-circle"> -->
<strong *ngIf="message.senderId == 1">Boost Promotions</strong>
<strong *ngIf="message.senderId == 2">Lion</strong>
</div>
<div *ngIf="messageContainer == 'Outbox'">
<strong *ngIf="message.recipientId == 2">Boost
Promotions</strong>
<strong *ngIf="message.recipientId == 1">Lion</strong>
</div>
</td>
<td>
<small class="text-muted">
<span class="fa fa-clock-o">{{message.messageSent | timeAgo}}
</span>
<span *ngIf="!message.isRead" class="text-muted text-danger">
(Unread)</span>
<span *ngIf="message.isRead" class="text-muted text-success">
(Seen)</span>
</small>
</td>
<td>
</tr>




*ngForinside another*ngFor? Like so:<div *ngFor="let message of messageSplit"> <td *ngFor="let item of message">{{item}}</td> </div>