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

ng-template won't load, missing internal SharedModule export inside p-menubar component #11538

Closed
ES-Six opened this issue May 21, 2022 · 1 comment
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@ES-Six
Copy link

ES-Six commented May 21, 2022

I'm submitting a bug report (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior

<ng-template pTemplate="start">...</ng-template> and <ng-template pTemplate="end">...</ng-template> are not loaded into DOM when using p-menubar inside a component of a lazy loaded module. But if I import the undocumented SharedModule into the LazyLoaded module, it works fine.

Expected behavior

<ng-template pTemplate="start">...</ng-template> and <ng-template pTemplate="end">...</ng-template> must be loaded by p-menubar when using it inside a component inside a lazy loaded Angular Module without having to import SharedModule (the primeng/api SharedModule) like other component does (ex : p-dropdown that export SharedModule internally, see : https://github.com/primefaces/primeng/blob/master/src/app/components/dropdown/dropdown.ts).

Minimal reproduction of the problem with instructions

Exemple of the bug (with comment showing the solution and the problem in the contact-base.component.html and contact.module.ts :

https://stackblitz.com/edit/primeng-menubar-demo-29wkyw

What is the motivation / use case for changing the behavior?

It's an undocumented behaviour.

The motivation is to improve consistency between the components of primeng (as some export SharedModule but p-menubar doesn't export it. And it will solve a bug too.

Please tell us about your environment:

  • Angular version: 13.x (bug is not related to Angular)
  • PrimeNG version: 13.4.0
  • Browser: all

Affect all browsers as this bug is not browser related.

  • Language: TypeScript ~4.6.2 (the version provided with the latest Angular version when generating a new Angular project.)

  • Node (for AoT issues): node --version = 16.14.2
    On windows with NPM 8.8.0

Issue is not environment related.

Note : if you want, I can make a PR to solve the problem by exporting the PrimeNG internal SharedModule from p-menubar component (e.g : like primeng already does inside p-dropdown). If you accept PR, I will modify this file by exporting SharedModule in it https://github.com/primefaces/primeng/blob/master/src/app/components/menubar/menubar.ts.

Thank you for reading

@cetincakiroglu cetincakiroglu self-assigned this May 23, 2022
@cetincakiroglu cetincakiroglu added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label May 23, 2022
@cetincakiroglu cetincakiroglu added this to the 13.Future milestone May 23, 2022
@ES-Six
Copy link
Author

ES-Six commented May 24, 2022

Thank you :)

cetincakiroglu added a commit that referenced this issue May 24, 2022
Fixed #11538 - MenuBar | ng-template won't load, missing internal Sha…
@cetincakiroglu cetincakiroglu modified the milestones: 13.Future, 13.4.2 May 24, 2022
Frequency21 added a commit to Frequency21/szakdolgozat that referenced this issue Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants