MEAN JS - 其中是主HTML文件(index.html)的位置 [英] MEAN JS - where is the main html file (index.html) located

查看:162
本文介绍了MEAN JS - 其中是主HTML文件(index.html)的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始学习MEAN JS,并试图找到主页面的html文件。不过,我只能在视图文件夹中看到home.client.view.html和header.clinet.view.html。



据我所知,通常有一个main包含主页所有信息的html,我们可以在主html文件中添加CSS文件和JS文件的链接。




$ b

如何在MEAN JS中添加额外的CSS文件和JS文件链接,因为我找不到主要的html文件? =h2_lin>解决方案

MEANJS顶层页面位于server / app / views / layout.server.view.html下,是您设置标题元标记的位置。大多数页面上的其他页面以编程方式插入,例如链接到CSS文件和Javascript文件。



您的服务器/公共目录下的任何CSS或Javascript文件自动添加到页面。如果您希望添加其他第三方脚本或样式表,可以通过编辑位于config / env / all.js的服务器配置文件来完成。



所以例如,将tinymce编辑器的角度版本添加到您的MEANJS站点,您可以通过将CSS添加到module.exports.assets.lib.css和对tinymce编辑器及其角度的引用来编辑config / env / all.js wrapper to module.exports.assets.lib.js。

如果您在服务器上更改此文件,则需要重新启动服务器(通过grunt命令)正在运行。



更新



使用 mean-cli@0.6.1 脚手架一个新的平均项目,默认的顶级页面位于 packages / custom / meanStarter / public / views / system 下,您可以找到两个文件:

  • header.html - 其中描述了默认导航栏的布局

  • index.html - whic h列出默认页面的内容



  • 现在,应该指出,正确的配置方式一个显示你自己的顶级主页的平均服务器是创建一个新的平均值包。



    请参阅 docs 了解更多信息。


    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?

    解决方案

    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.

    这篇关于MEAN JS - 其中是主HTML文件(index.html)的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆