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
}
}