📜  Angular CLI-ng help命令(1)

📅  最后修改于: 2023-12-03 14:39:12.797000             🧑  作者: Mango

Angular CLI-ng help命令介绍
简介

ng help 命令是 Angular CLI 提供的一个非常有用的命令,它可以帮助你查看所有可用的命令及其用法。在开发 Angular 应用过程中,当你遇到问题或需要使用一个新的命令时,你都可以使用 ng help 命令查看命令的用法和参数。

命令格式
ng help [command]

如果指定了命令名,ng help 命令会显示该命令的用法和参数;如果没有指定命令名,则会显示所有可用的命令。

例子
ng help serve

该命令将显示 ng serve 命令的用法和参数:

Usage: ng serve [options] [project]

Serve an Angular app.

Options:
  --ssl                        HTTPS server
  --ssl-key                    SSL key to use for serving HTTPS
  --ssl-cert                   SSL certificate to use for serving HTTPS
  --host <hostname>           Name of the host on which to listen for connections
  --port <port>               Port number to listen on for connections
  --disable-host-check        Don't verify connected clients are part of allowed hosts.
  --public-host <hostname>    Specify the URL to use for the application.
  --serve-path <path>         The pathname where the app will be served.
  --live-reload               Whether to reload the page on change, using live-reload.
  --live-reload-client        Deprecated. Use "script=auto" instead.
  --live-reload-host          The hostname used for LiveReload client (default: hostname)
  --live-reload-base-url      The base URL for LiveReload (default: '/').
  --live-reload-port          The port to bind the LiveReload client to.
  --live-reload-protocol      The protocol for the LiveReload to use.
  --disable-analytics         Disable analytics tracking for this command.
  --hmr                       Enable hot module replacement.
  --configuration             Specify the configuration to use.
  --proxy-config              Proxy configuration file.
  --watch                     Run build when files change.
  --open                      Open the browser.
  --open-api                  API endpoint to open in the browser.
  --assets <path>             Directory or file to serve as assets.
  --i18n-file                 Localization file to use for i18n.
  --i18n-format               Format of the localization file specified with --i18n-file.
  --locale                    Locale to use for i18n.
  --missing-translation       How to handle missing translations for i18n.
  --extract-csso              Extract the CSS from the bundle in the given file.
  --allowed-hosts             A comma-separated list of hosts that are allowed to access the dev server.

Arguments:
  project                    The name of the project to build. Can be an app or a library.
总结

ng help 命令是非常有用的工具,可以帮助你快速获取命令及其参数的用法,以提高开发效率。当你不确定某个命令的用法时,不要忘记使用该命令来获得帮助。