1

I am trying to add angular/material into the angular 16 project For that i have created app.module.ts and mycomponent.module.ts & mycomponent.component.html. Trying to run the 'ng serve' giving below err-

l:3:9 - error NG8001: 'mat-paginator' is not a known element:
1. If 'mat-paginator' is an Angular component, then verify that it is part of this module.
2. If 'mat-paginator' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3         <mat-paginator #paginator [pageSizeOptions]="[5,10,15]" />

Imported as well as Exported the MatPaginatorModule in app.module.ts

import {mport { MatPaginatorModule } from '@angular/material/paginator';}
@NgModule({

imports: [ 

MatPaginatorModule ],
exports: [ 

MatPaginatorModule ],

schemas : [CUSTOM_ELEMENTS_SCHEMAS],

Similarly imported in mycomponent.module.ts as below

import {mport { MatPaginatorModule } from '@angular/material/paginator';}

html is declared in mycomponent.component.html

<mat-paginator #paginator 
               [length]="100" 
               [pageSize]="10" 
               [pageSizeOptions]="[5, 10, 25, 100]">
</mat-paginator>

doing all these on 'ng serve' throwing above err

Anushweta
  • 21
  • 5

0 Answers0