This all works OK for my components, but when I add PrimeNG components I get the following error:
I have created a little example of the problem. The following is an example component that contains a PrimeNG p-button component:error NG8001: 'p-table' is not a known element:
Code: Select all
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-example',
template: `
<p>example works!</p>
<p-button label="Click" ></p-button>
`
})
export class ExampleComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
Code: Select all
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ExampleComponent } from './example/example.component';
//
@NgModule({
declarations: [ExampleComponent],
exports: [ExampleComponent],
imports: [
CommonModule
]
})
export class IssuesModule { }
How do I get the above code design to work?