【发布时间】:2018-05-08 07:02:25
【问题描述】:
我需要通过在浏览器中手动打开 index.html 文件来在浏览器中运行 Angular 5 应用程序。我的客户没有任何服务器。他只是想让我给他发送一个包(dist 文件夹),然后只需双击 index.html 文件即可在浏览器中将应用程序作为网站运行。
ng build --prod --base-href ./ 已完成,我的 dist 文件夹中有文件。我不能使用任何服务器节点/IIS,因为我不能要求我的客户安装这些服务器作为先决条件。
【问题讨论】:
-
尝试:1.-使用 hashLocationStrategies angular.io/api/common/HashLocationStrategy#hashlocationstrategy, 2.- 更改 index.html 的基本标签,例如 document.write('
');
标签: javascript angular