mean.js menu isPublic not working

∥☆過路亽.° 提交于 2019-11-30 14:50:59

If you look in menus.client.services.js in the core module of mean.js the last line looks like this: this.addMenu('topbar');. If you change it to this.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 the true as it will inherit it from the setting that was just changed:

Menus.addMenuItem('topbar', 'Talks', 'talks', 'dropdown', '/talks(/create)?');
OR
Menus.addMenuItem('topbar', 'Talks', 'talks', 'dropdown', '/talks(/create)?', true);

Or like below if you now want it to hide when not signed in:

Menus.addMenuItem('topbar', 'Talks', 'talks', 'dropdown', '/talks(/create)?', false); 

I hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!