Prime ng table on change detection(on push) calls the method inside the template

  angular, primeng, primeng-datatable

In an Html template I have prime Ng table and a button inside it.
Need to enable disable button based on some multiple conditions so have added one method in the template to make that decision like [disable]="myMethod(data)",while clicking anywhere the method gets called every time.

Note: I have Also used lazy Loading in prime Ng table.

Code tried as below

@Component({
  selector: 'app-add-client',
  templateUrl: './add-client.component.html',
  styleUrls: ['./add-client.component.css'],
  changeDetection: ChangeDetectionStrategy.OnPush
})

Any suggestions/ideas how to overcome this overhead.

Source: Angular Questions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.