ng-template won't load, missing internal SharedModule export inside p-menubar component #11538
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
I'm submitting a bug report (check one with "x")
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:
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.2On 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
The text was updated successfully, but these errors were encountered: