How to make PrimeNG Menubar component work?
I had the same problem, and searching everywhere, even in this post, I was able to solve it, just configuring a simple empty Route:
app.module.ts
import { RouterModule } from '@angular/router';@NgModule({...imports: [ RouterModule.forRoot([]), ... ]...})
index.html:
<script>document.write('<base href="' + document.location + '" />');</script>
Try importing both Menubar and MenuItem
import {Menubar,MenuItem} from 'primeng/primeng';
As per your menubardemo.components.ts, you are using only MenuItem.
I ran into a similar issue. In my case my application is not using routing, but PrimeNG still requires it. There is an open request to make the router optional, but PrimeNG hasn't responded to that. So I created my own router service:
export class Router{ constructor(){} public navigate(route: any[]):void { // Do nothing }}
Then I modified my systemjs.config.js
to point @angular/router
to my new router. This worked great and I can use the component without needing the router.