--disable-host-check与--disableHostCheck

时间:2019-04-25 13:55:43

标签: angular

黄色是ng --version的输出。如果我理解正确,那么我的Angular版本是5.2.2,如果我错了,请纠正我:

c:\Users\wakatana\Documents\coding\my-angular-app>ng --version
Your global Angular CLI version (6.2.4) is greater than your local
version (1.6.6). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.6.6
Node: 8.9.3
OS: win32 x64
Angular: 5.2.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cdk: 5.1.1
@angular/cli: 1.6.6
@angular/flex-layout: 2.0.0-beta.12
@angular/material: 5.1.1
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.6
@schematics/angular: 0.1.17
typescript: 2.4.2
webpack: 3.10.0

我需要调试一些与CORS相关的问题。所以我想用禁用主机检查来启动我的应用程序。我的应用程序通过以下任何命令启动:

ng serve --app my-angular-app --host 0.0.0.0 --disable-host-check
ng serve --app my-angular-app --host 0.0.0.0 --disable-host-check=true
ng serve --app my-angular-app --host 0.0.0.0 --disable-host-check true
ng serve --app my-angular-app --host 0.0.0.0 --disableHostCheck
ng serve --app my-angular-app --host 0.0.0.0 --disableHostCheck=true
ng serve --app my-angular-app --host 0.0.0.0 --disableHostCheck true

这对我来说很可疑,我不知道禁用主机检查是否有任何影响。我敢打赌,我曾经读过某个地方disableHostCheckdisable-host-check应该用于不同版本的angular。但是我找不到任何文档。在我的情况下,我应该使用哪一个?这在哪里记录?谢谢

0 个答案:

没有答案