Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pTemplate not working for p-toolbar alone #15608

Closed
krabouilleur opened this issue May 17, 2024 · 4 comments · Fixed by #15755
Closed

pTemplate not working for p-toolbar alone #15608

krabouilleur opened this issue May 17, 2024 · 4 comments · Fixed by #15755
Labels
LTS-PORTABLE Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@krabouilleur
Copy link

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 krabouilleur added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label May 17, 2024
@maruthumj
Copy link
Contributor

@krabouilleur please create a sample app in stackblits to investigate this issue further.

@Sinan997
Copy link
Contributor

Sinan997 commented May 18, 2024

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],

@SoyDiego
Copy link
Contributor

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],

@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.

image

@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels May 30, 2024
@cetincakiroglu cetincakiroglu added this to the 17.18.0 milestone May 30, 2024
cetincakiroglu added a commit that referenced this issue May 30, 2024
Fixed #15608 - Add missing import & export of sharedModule
@alaindeurveilher
Copy link

alaindeurveilher commented Jun 3, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTS-PORTABLE Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
6 participants