pTemplate not working for p-toolbar alone
Describe the bug
on a standalone component:
the ts
@Component({
selector: 'app-menu',
standalone: true,
imports: [ToolbarModule, AsyncPipe],
....
<p-toolbar >
<ng-template pTemplate="end">
------> !!!!!!!!!!!!!!! IS NOT SHOWING
</ng-template>
</p-toolbar>
but the content of ng-template is showing if I add a cardModule the ts
@Component({
selector: 'app-menu',
standalone: true,
imports: [ToolbarModule, AsyncPipe, CardModule],
....
<p-toolbar >
<ng-template pTemplate="end">
------> !!!!!!!!!!!!!!! IS WORKING
</ng-template>
</p-toolbar>
Environment
"primeng": "^17.16.1", "@angular/core": "^17.3.0",
Reproducer
No response
Angular version
17.3
PrimeNG version
17.16.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
20.9.0
Browser(s)
chrome
Steps to reproduce the behavior
No response
Expected behavior
No response
@krabouilleur please create a sample app in stackblits to investigate this issue further.
Hi @krabouilleur, please import SharedModule to be able to use PrimeTemplate Directive.
import { ToolbarModule } from 'primeng/toolbar';
import { SharedModule } from 'primeng/api';
@Component({
selector: 'app-menu',
standalone: true,
imports: [ToolbarModule, SharedModule],
Hi @krabouilleur, please import
SharedModuleto be able to usePrimeTemplateDirective.import { ToolbarModule } from 'primeng/toolbar'; import { SharedModule } from 'primeng/api'; @Component({ selector: 'app-menu', standalone: true, imports: [ToolbarModule, SharedModule],
@Sinan997 you are right here. @krabouilleur you should import the SharedModule.
I have created a PR and added a line in Imports to be clear.
There is the same issue for the p-menu component. Should a new issue be created? Because the document does not mention the import of SharedModule neither.