How to test an app created with Angular CLI ng serve from another device?

前端 未结 5 1901
轮回少年
轮回少年 2021-02-02 07:37

I have an app generated with Angular CLI from scratch. CLI version angular-cli: 1.0.0-beta.11-webpack.2

I am trying to test it from my smartphone but I get

5条回答
  •  借酒劲吻你
    2021-02-02 08:06

    Adding the host-flag with value "0.0.0.0" should allow you to access the webserver from any device on your local network.

    This should work: ng serve --host 0.0.0.0

    For an explanation: https://github.com/angular/angular-cli/pull/1475#issuecomment-235986121

提交回复
热议问题