In a mean.js app, I wanted to display the menu items in the top navbar while the user is signed in as well as signed out. The menu items are displaying while the user is signed in, however, that is not happening when the user is signed out.
The mean.js docs state setting the 'isPublic' property to true will allow for the menu items to be shown on the navbar while user is signed out; but that is not working. Here is the code:
Menus.addMenuItem('topbar', 'Talks', 'talks', 'dropdown', '/talks(/create)?', true); Menus.addSubMenuItem('topbar', 'talks', 'List Talks', 'talks'); Menus.addSubMenuItem('topbar', 'talks', 'New Talk', 'talks/create');
The solutions I looked at, all suggest to set the isPublic property to true, but there seems to be too much confusion around this subject. Anyone with answers?
If you look in
menus.client.services.js
in thecore
module of mean.js the last line looks like this:this.addMenu('topbar');
. If you change it tothis.addMenu('topbar', true);
. You will see all your menu items showing on the topbar when you aren't logged in. Then you can add your menu item like in your example or without thetrue
as it will inherit it from the setting that was just changed:Or like below if you now want it to hide when not signed in:
I hope this helps.