After spending few hours on this i think this is best way to apply pagination. And more importantly it works.
This is my paginator code
<mat-paginator #paginatoR [length]="length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions">
Inside my component @ViewChild(MatPaginator) paginator: MatPaginator;
to view child and finally you have to bind paginator to table dataSource and this is how it is done
ngAfterViewInit() {this.dataSource.paginator = this.paginator;}
Easy right? if it works for you then mark this as answer.