primeng dropdown component error ('p-dropdown' is not a known element)

You have to add DropdownModule in imports section in the app module or the module where the TestdropdownComponent is declared.


If still this issue persists, you might have to test one more thing, i.e., if "FormsModule" is imported, if not import it and try,

import { FormsModule } from '@angular/forms';
import { DropdownModule } from 'primeng/primeng';

@NgModule({
  imports: [
    DropdownModule,
    FormsModule
  ],

This should solve the issue.


Import the dropdown module in the module where you declare your component.

import {DropdownModule} from 'primeng/primeng';

@NgModule({
  imports: [
   DropdownModule
  ],
  declarations: [TestdropdownComponent ]

})
export class myModule { }