@ViewChild('paginator', {static: true}) paginator:Paginator;
this paginator is undefined when I console in ngOnInit function.
why?
I tried to print prime-ng paginator in component file with using view child.but it's getting undefined.
@ViewChild('paginator', {static: true}) paginator:Paginator;
this paginator is undefined when I console in ngOnInit function.
why?
I tried to print prime-ng paginator in component file with using view child.but it's getting undefined.
You have to add any logic you want to perform inside of ngAfterViewInit
callback. During ngOnInit
the the template isn't fully rendered yet.