p-table not displayed in page #3259
Replies: 1 comment 1 reply
-
Got the Issue and Fixed it |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have copied the code exactly from primeng ptable examples. But the table refuses to get displayed in the page.. Please help
html
<div class="row"> <div class="card-inner row-border"> <h4 class="fw-bold top-margin">Observations</h4> <div> <p-table [value]="observationsData" [tableStyle]="{'min-width': '40rem', 'min-height': '10rem'}"> <ng-template #header> <tr> <th>Sr No</th> <th>Observations</th> <th>Remarks</th> </tr> </ng-template> <ng-template #body let-observationsData> <tr> <td>{{observationsData.srno}}</td> <td>{{observationsData.observations}}</td> <td>{{observationsData.remarks}}</td> </tr> </ng-template> </p-table> </div> </div> </div>
ts code `import { Component, Input, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { NgbActiveModal, NgbTypeahead } from '@ng-bootstrap/ng-bootstrap';
import { debounceTime, distinctUntilChanged, filter, map, merge, Observable, OperatorFunction, Subject } from 'rxjs';
import { ObservationsService } from '../../shared/services/observations.service';
import { Observations } from '../../domain/observations';
@component({
selector: 'app-repairable-details',
templateUrl: './repairable-details.component.html',
styleUrl: './repairable-details.component.scss',
})
export class RepairableDetailsComponent implements OnInit{
observationsData!: Observations[];
constructor(private observationService: ObservationsService) { }
ngOnInit(): void {
this.observationService.getObservations().then((data) => {
this.observationsData = data;
});
}
}`
Beta Was this translation helpful? Give feedback.
All reactions