简体   繁体   English

Angular项目在同一网络的某些计算机上显示空白页

[英]Angular project shows blank page on some computers at the same network

I run an angular 2 project with ng serve --host 0.0.0.0 --port 4000 and try to access it from computers on the same network.我使用 ng serve --host 0.0.0.0 --port 4000 运行 angular 2 项目,并尝试从同一网络上的计算机访问它。 On some computers it loads perfectly and on some it shows an empty page with no error in the console.在某些计算机上,它可以完美加载,而在某些计算机上,它会在控制台中显示一个没有错误的空白页面。 I checked the index page html and i see there the title and the icon but no directives on the app-root or the styles in the header.我检查了索引页面 html 并且我看到了标题和图标,但在应用程序根目录或 header 中的 styles 上没有指令。 Thanks for helping:)感谢您的帮助:)

try this尝试这个

ng serve --host 0.0.0.0 --port 4000 --disable-host-check

and be sure that in that computer firewall allow it并确保在该计算机防火墙中允许它

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM