Sails.js- how to move the Top nav to a component?
问题 I needed a top-nav with a good amount of extras and flexabliltiy. I also didnt want my layout.ejs to become a tangled mess. So I moved my top-nav into a component and wanted to share how I did it here. 回答1: Create a new component in assest/js/components/ (I look at the existing components that come with the Sails app for reference) I named mine masthead Built my nav-bar in the component Removed any mention of the top-nav in layout.ejs
Added <masthead></masthead> to all HTML files that will