Home Angular 13 Solved – Angular Material Property ‘paginator’ has no initializer and is not definitely assigned in the constructor

Solved – Angular Material Property ‘paginator’ has no initializer and is not definitely assigned in the constructor

by therichpost
4 comments
Solved - Angular Material Property 'paginator' has no initializer and is not definitely assigned in the constructor

Hello guys how are you? Welcome back to my blog therichpost.com. Today in this blog post, I am going to tell you how to Solved – Angular Material Property ‘paginator’ has no initializer and is not definitely assigned in the constructor issue?

Property 'paginator' has no initializer and is not definitely assigned in the constructor
Property ‘paginator’ has no initializer and is not definitely assigned in the constructor

Guys I got this error during code implementing Material Datatable into my Angular 13 Application and using below code snippet and add that inside our component.ts file and we can solved that issue.

@ViewChild(MatPaginator) paginator :any = MatPaginator;

Angular 13 came and if you are new then you must check below two links:

  1. Angular 13 Demos
  2. AngularMaterial

I will appreciate that if you will tell your views for this post. Nothing matters if your views will be good or bad because with your views, I will make my next posts more good and helpful.

Jassa

Thanks

You may also like

4 comments

Manoj April 28, 2022 - 5:59 am

Its Working fine fore me. Thank you

Reply
Ajay Malhotra April 28, 2022 - 6:03 am

Awesome great to hear that.

Reply
ailtonbsj July 30, 2022 - 2:30 am

I do this to solve:

@ViewChild(MatSort) sort: MatSort = {};
@ViewChild(MatPaginator) paginator: MatPaginator = {};

This way also works:

@ViewChild(MatSort) sort: MatSort | null = null;
@ViewChild(MatPaginator) paginator: MatPaginator | null = null;

Reply
therichpost July 31, 2022 - 6:11 am

Good

Reply

Leave a Comment

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