i am trying to loop an array each object in this array is a table on html.
and it display like this :
<p-table [value]="section" *ngFor="let section of sections">
<ng-template pTemplate="header">
<tr>
<th>Quantity</th>
<th>Length</th>
<th>m^2</th>
<th></th>
</tr>
<tr>
<th colspan="4">
<div (click)="showDialog()" class="text-left">+ A - Flat Panel RAW MDF Red Gloss
- $95 / sqm
</div>
</th>
<th colspan="8">
<div class="md-inputfield">
<input type="text" class="form-control" pInputText>
</div>
</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-rowData *ngFor="let piece of rowData.Pieces">
<tr>
<td>
<p-spinner [(ngModel)]="rowData.Quantity"></p-spinner>
</td>
<td pEditableColumn>
<p-cellEditor>
<ng-template pTemplate="input">
<input type="text" [(ngModel)]="rowData.Length">
</ng-template>
<ng-template pTemplate="output">
{{rowData.Length}}
</ng-template>
</p-cellEditor>
</td>
<td>
{{CalculateTotalArea(rowData)}}
</td>
<td>
<button pButton type="button" icon="fa-close"></button>
</td>
</tr>
</ng-template>
</p-table>
but this give me an error this.value.sort is not a function
and here is array
this.pieces = [{
Quantity: 2, Length: 3, Width: 3, Thickness: 4
}]
this.sections = [
{ Pieces: this.pieces, text: "abc" }
]
i am trying to push code into Plunker but i don't know how to upgrade version of primeng to "primeng": "^5.2.0-rc.1",
then the Plunker is't working right now
anyone help me update the primeng library and suggest me how to resolve this bug .
here is the link Plunker : Plunker
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…