MEAN JS - where is the main html file (index.html) located

微笑、不失礼 提交于 2019-12-10 13:28:00

问题


I just started learning MEAN JS and I am trying to find the html file for the main page. However I only see home.client.view.html and header.clinet.view.html in the view folder.

From what I know is, usually there is a main html which holds all the information of the home page, and we can add links of CSS files and JS files in the main html file.

How can I add links of extra CSS files and JS files in MEAN JS since i cannot find the main html file?


回答1:


The MEANJS top level page is located under server/app/views/layout.server.view.html and is where you set header meta tags. Most everthing else on the page is programmatically inserted by angular, such as links to CSS files and Javascript files.

Any of the CSS or Javascripts files under your server/public directly are automagically added to the page. If you wish to add other, third-party scripts or stylesheets, you do so by editing your server configuration file, located at config/env/all.js.

So for example, to add the angular version of the tinymce editor to your MEANJS site, you'd edit config/env/all.js by adding CSS to module.exports.assets.lib.css and references to the tinymce editor and its angular wrapper to module.exports.assets.lib.js.

You will need to restart your server (via the 'grunt' command) if you change this file while the server is running.

UPDATE

Using mean-cli@0.6.1 to scaffold a new mean project, the default "top-level" page is located under packages/custom/meanStarter/public/views/system where you will find two files:

  • header.html - which describes the layout of the default navbar
  • index.html - which lays out the content of the default page

Now, having said that, it should be noted that the "proper" way of configuring a mean server to display your own top-level homepage is to create a new mean package.

See the docs for further information.



来源:https://stackoverflow.com/questions/26498540/mean-js-where-is-the-main-html-file-index-html-located

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