Search code examples
angularprimengpaginator

p-table rowsPerPageOptions does not expand the dropdown


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?


Solution

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

    import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 
    
    @NgModule({
      imports: [ BrowserModule,BrowserAnimationsModule ... ]
      // ...
    })