p-table error , ExpressionChangedAfterItHasBeenCheckedError

UI Components for Angular
Post Reply
eloy.silva
Posts: 2
Joined: 03 Apr 2021, 04:24

03 Apr 2021, 04:36

in this code :

Code: Select all

 p-table [value]="datasource"  [lazy]="true" (onLazyLoad)="loadData($event)" [paginator]="true" [rows]="PageSize"
       
        
generates error when using property [lazy] = true

Code: Select all


ERROR Error: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'undefined'. Current value: 'true'.. Find more at https://angular.io/errors/NG0100
  
I would greatly appreciate your help

Thanks

eloy.silva
Posts: 2
Joined: 03 Apr 2021, 04:24

10 Apr 2021, 18:57

the solution i found is:

Code: Select all

import { ChangeDetectorRef, Component, OnInit } from '@angular/core';

Code: Select all


  ngAfterViewInit() {
    this.cd.detectChanges();
  }

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 7 guests