@den4ik92/ng2-smart-table 19.6.4 → 19.6.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2612,12 +2612,17 @@ class Ng2SmartTableComponent {
2612
2612
  ngAfterViewInit() {
2613
2613
  this.setupResizeObserver();
2614
2614
  if (this.isPagerDisplay() && this.paginationSlot()) {
2615
- this.paginationComponentRef = this.paginationSlot().createComponent(PagerComponent, {
2616
- injector: this.injector,
2617
- });
2618
- this.paginationComponentRef.setInput('source', this.source());
2619
- if (this.paginationTemplateData()) {
2620
- this.paginationComponentRef.setInput('content', this.paginationTemplateData());
2615
+ try {
2616
+ this.paginationComponentRef = this.paginationSlot().createComponent(PagerComponent, {
2617
+ injector: this.injector,
2618
+ });
2619
+ this.paginationComponentRef.setInput('source', this.source());
2620
+ if (this.paginationTemplateData()) {
2621
+ this.paginationComponentRef.setInput('content', this.paginationTemplateData());
2622
+ }
2623
+ }
2624
+ catch {
2625
+ //do nothing
2621
2626
  }
2622
2627
  }
2623
2628
  }
@@ -2625,7 +2630,7 @@ class Ng2SmartTableComponent {
2625
2630
  this.grid.detach();
2626
2631
  this.destroyResizeObserver();
2627
2632
  if (this.paginationComponentRef) {
2628
- this.paginationComponentRef.destroy();
2633
+ this.paginationComponentRef?.destroy();
2629
2634
  this.paginationComponentRef = null;
2630
2635
  this.paginationSlot()?.detach();
2631
2636
  }
@@ -2720,7 +2725,7 @@ class Ng2SmartTableComponent {
2720
2725
  });
2721
2726
  }, 20);
2722
2727
  });
2723
- const hostElement = this.elementRef.nativeElement;
2728
+ const hostElement = this.elementRef?.nativeElement;
2724
2729
  if (hostElement) {
2725
2730
  this.resizeObserver.observe(hostElement);
2726
2731
  }