Skip to content

Commit f4aa0df

Browse files
authored
Merge pull request #3068 from IgniteUI/thristodorova/fix-3005
Fix ExpressionChangedAfterItHasBeenCheckedError in Grid Pager sample
2 parents 5b90e34 + 9877f1e commit f4aa0df

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/app/grid/grid-pager-sample/grid-pager-sample.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core';
1+
import { Component, OnInit, ViewChild, AfterViewInit, ChangeDetectorRef } from '@angular/core';
22
import { athletesData } from '../../data/athletesData';
33
import { IPaginatorResourceStrings, IgxPaginatorComponent } from 'igniteui-angular';
44

@@ -22,6 +22,8 @@ export class GridPagerSampleComponent implements OnInit, AfterViewInit {
2222
igx_paginator_label: 'Records per page'
2323
};
2424

25+
constructor(private cdr: ChangeDetectorRef) {}
26+
2527
public ngOnInit(): void {
2628
this.data = athletesData;
2729
this.densityOptions = ['compact', 'cosy', 'comfortable'];
@@ -31,5 +33,6 @@ export class GridPagerSampleComponent implements OnInit, AfterViewInit {
3133
requestAnimationFrame(() => {
3234
this.paginator.resourceStrings = this.paginatorResourceStrings;
3335
});
36+
this.cdr.detectChanges();
3437
}
3538
}

0 commit comments

Comments
 (0)