Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

317
Visualizações
<PrimeNG component> is not a known element even when imported

I'm trying to use the table component from the PrimeNG library in order to create a list of users. Even though the Table module is declared in the module "closest" to my component, I get the NG8001: 'p-table' component is not a known element error. I'm also using tailwind for CSS.

I already tried to declare the table module in the other modules I have in my app in case I made something wrong about this part but in vain. This makes me think it might be a lower level issue

Here is some code of my module :

import {TableModule} from "primeng/table";
// Other imports

@NgModule({
  declarations: [
    UsersComponent, // My component
  ],
    imports: [
        CommonModule,
        HttpClientModule,
        TableModule,
    ]
})
export class AdminDashboardModule { }

users.component.html :

<h1>Active users</h1>
<div class="border-b border-gray-200 shadow w-full">
  <p-table [value]="users">
    <ng-template pTemplate="header">
      <tr>
        <th>Username</th>
        <!-- Other headers -->
      </tr>
    </ng-template>
    <ng-template pTemplate="body" let-user>
      <tr>
        <td>{{user.username }}</td>
        <!-- Other values -->
      </tr>
    </ng-template>
  </p-table>
</div>

users.component.ts :

// Imports

@Component({
  selector: 'app-users',
  templateUrl: './users.component.html',
  styleUrls: ['./users.component.css']
})
export class UsersComponent implements OnInit {
  public users: User[];

  constructor(private userService: UserService) { }

  ngOnInit(): void {
    // Call to userService supplying users variable 
  }

}

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda