Base solution for your next web application
Open Closed

dataTable is undefined when copy and paste dataTable to another page #9417


User avatar
0
oaksakal created

Hi,

I am trying to move a componentName.component html and ts files to another page. I want to add these to another page view.componentName.component.html and ts files.

I copied and pasted first componentName.component.html (from primeng start to primeng finish) and also copied and pasted componentName.component.ts functions to another view.componentName.ts file. Also I added ViewChild('dataTable') dataTable: Table and paginator as well.

But I am getting this error and stucks in loading.

I tried console.log(this.dataTable) in getEmployeeServiceAssignments method and it says undefined.

I could not understand what I am missing.


1 Answer(s)
  • User Avatar
    0
    oaksakal created

    I removed *ngIf in tabs and fixed as mentioned here