0
votes

I'm using the p-table component trying to show the paginator with the dropdown with rows per page option (rowsPerPageOptions):

<p-table
  [columns]="cols"
  [value]="myData"
  [paginator]="true"
  [rows]="2"
  [rowsPerPageOptions]="[1,2,3]">

The table shows up fine with the paginator control, but the dropdown that contains the per-page option does not expand (drop).

Here's the stackblitz link of the app - https://stackblitz.com/edit/angular-xywt2w?file=app/provider-search/provider-search.component.html

Why does the dropdown not work?

2

2 Answers

2
votes

Correct form:

[rowsPerPageOptions]="['5', '10', '20', '50']"
1
votes

Make sure you import BrowserAnimationsModule in your app.module.ts

import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 

@NgModule({
  imports: [ BrowserModule,BrowserAnimationsModule ... ]
  // ...
})